B0011 Number Systems ENGR xD52 Eric VanWyk Fall 2012.

Slides:



Advertisements
Similar presentations
HEXADECIMAL NUMBERS Code
Advertisements

COE 202: Digital Logic Design Signed Numbers
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Representations Example: Numbers –145 –CVL – –91 –
1 Binary Arithmetic, Subtraction The rules for binary arithmetic are: = 0, carry = = 1, carry = = 1, carry = = 0, carry =
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
ECE 331 – Digital System Design
ECE 301 – Digital Electronics Number Systems and Conversion, Binary Arithmetic, and Representation of Negative Numbers (Lecture #10) The slides included.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
Number System and Codes
1 Binary Numbers Again Recall that N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to bits.
COMP201 Computer Systems Number Representation. Number Representation Introduction Number Systems Integer Representations Examples  Englander Chapter.
Dr. Bernard Chen Ph.D. University of Central Arkansas
Binary Representation - Shortcuts n Negation x + x = 1111…1111 two = -1 (in 2’s complement) Therefore, -x = x + 1 n Sign Extension o Positive numbers :
Simple Data Type Representation and conversion of numbers
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Data Representation – Binary Numbers
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
Data Representation and Computer Arithmetic
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
1 Digital Design: Number Systems Credits : Slides adapted from: J.F. Wakerly, Digital Design, 4/e, Prentice Hall, 2006 C.H. Roth, Fundamentals of Logic.
46 Number Systems Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs Display: Seven segment displays Inputs: Switches.
Representation of Data Ma King Man. Reference Text Book: Volume 2 Notes: Chapter 19.
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
ECE 331 – Digital System Design
1 EENG 2710 Chapter 1 Number Systems and Codes. 2 Chapter 1 Homework 1.1c, 1.2c, 1.3c, 1.4e, 1.5e, 1.6c, 1.7e, 1.8a, 1.9a, 1.10b, 1.13a, 1.19.
Dr. Ahmed Telba EE208: Logic Design Lecture# 1 Introduction & Number Systems.
BR 8/99 Binary Numbers Again Recall than N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to 255.
ECE2030 Introduction to Computer Engineering Lecture 2: Number System Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Tech.
Number Base Conversions
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
Operations on Bits Arithmetic Operations Logic Operations
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
Number Systems and Logic Prepared by Dr P Marais (Modified by D Burford)
AEEE2031 Data Representation and Numbering Systems.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Digital Representations ME 4611 Binary Representation Only two states (0 and 1) Easy to implement electronically %0= (0) 10 %1= (1) 10 %10= (2) 10 %11=
69 Decimal (Base 10) Numbers n Positional system - each digit position has a value n 2534 = 2*1, * *10 + 4*1 n Alternate view: Digit position.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
NUMBER SYSTEMS.
IT1004: Data Representation and Organization Negative number representation.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
In decimal we are quite familiar with placing a “-” sign in front of a number to denote that it is negative The same is true for binary numbers a computer.
Number Representation (Part 2) Computer Architecture (Fall 2006)
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
Lecture 2: 8/29/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Addition and Subtraction
ENGR xD52 Eric VanWyk Fall 2014
Integer Real Numbers Character Boolean Memory Address CPU Data Types
CHAPTER 1 : INTRODUCTION
Digital Systems and Binary Numbers
Negative Binary Numbers
CSE 102 Introduction to Computer Engineering
Chapter 3 Data Representation
Binary Addition & Subtraction
Data Representation Data Types Complements Fixed Point Representation
Data Representation in Computer Systems
Data Representation – Chapter 3
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Digital Logic Design (CSNB163)
Presentation transcript:

b0011 Number Systems ENGR xD52 Eric VanWyk Fall 2012

Today Homework! Radix R Numbers Negative Numbers Fixed Point

There are 10 types of people Those that understand binary Those that do not And those who do not presume Radices…

Rebasing and Reradixing 123 = 1*(10^2) + 2*(10^1) + 3*(10^0) This is true for all Radices! h123 = 1*(h10^2) + 2*(h10^1) + 3*(h10^0) – 1*d16^2 + 2*d16^1 + 3*d16^0 = d291 o123 = 1*(o10^2) + 2*(o10^1) + 3*(o10^0) – 1*d8^2 + 2*d8^1 + 3*d8^0 = d83

Innocence Lost You can not assume to know the base of a number without context or indication. Be Explicit.

Common Indicators Hexadecimal – D = ABCDEF – 0x1234 – h1234 – Octal – D = – – o1234 – Decimal(10) – D = – 1234 – d1234 – Binary (Base 2) – D = 01 – 0b1010 – b1010 –

Radix Conversion General Conversion to base Base – Digit = (Input) % (Base) – Input = (Input) / (Base) – Repeat until Input is exhausted (zero) writing digits ‘right to left’. Or, left to right. – Digit = (Input) / (Base^ position) – Input = (input) – Digit * (Base ^ position) Picking arbitrary digits?

Radix Conversion When converting between bases that are powers of each other, the division operation becomes trivial. – 1 Hex digit = 4 binary digits – 3 Binary digits = 1 Octal digit – 1 R=r^n digit = n R=r digits

BOARDS Convert to Decimal – b o325hE32 Convert 79 from Decimal to Bin, Oct, and Hex = ??? 9 Multiply d29 by hf – In Binary – In Quaternary (R=4) – In Hex Pay close attention to the carry logic…

Additional Radix Carrying Food for Thought - A Radix R adder uses a single carry out digit for 11 inputs. One of those is used by the carry in. That leaves us with 10 (R) inputs.

Negative Numbers A tale of 3 cities. Sign / Magnitude – One bit denotes sign, rest denotes magnitude 1’s Compliment (Inverse) – Negative is the inverse of Positive 2’s Compliment – Negative is the compliment w.r.t. R^N (2^N)

R’s Compliment A + -A = R^N Example: R = 10, N=1 – 6-3 = 3 – R^N – A = -A – 10^1 – 3 = 7 – 6+7 = 13 = 3 – Adding 7 is like subtracting 3, but carry magic.

2’s Compliment Shortcut: Invert, add 1. 2: b0010 2̅: b1101 2̅ +1:b :b1110 Note: ‘Extra’ negative number!

14 Addition in Two’s Complement ( -2) (+4) (+2) (+4) (-2) (-4) (+2) ( -4)

15 Subtraction in Two’s Complement A - B = A + (-B) = A + B̅

Sign Extension in R’s Compliment Positive numbers – Left pad with 0 Negative Numbers – Left Pad with (R-1)s 2’s Compliment – Left Duplicate the most significant (sign) bit.

17 Overflows in Two’s Complement Add two positive numbers to get a negative number or two negative numbers to get a positive number = =

18 Overflow Detection in 2’s Complement Overflow No overflow Overflow when carry in to sign does not equal carry out

Fixed Point Numbers Integer scaled by a fixed factor. Fixed number of digits before and after the radix point. – b = 2^2 + 2^0 + 2^-1 + 2^-2 = 5.75 IQ Notation – I8Q24Signed, 8 bits before, 24 bits after – U16Q16Unsigned, 16 before, 16 after

Fixed Point Options

MOAR BOARDS For Each: – What IQ should you use? – Convert to binary IQ – Do the math in binary Maintaining decimal place Fixing it later – * * -0.5