EGRE 254 Number Systems and Codes 1/12/09

Slides:



Advertisements
Similar presentations
ECE 331 – Digital System Design
Advertisements

NUMBER SYSTEM. How to convert hexadecimal numbers to decimal numbers? 230 Working from right to left, MULTIPLY each position with 8 raised to the power.
Appendix 1 Number Systems Objectives: Review of number systems and radix conversion methods Review of binary, octal, hexadecimal and BCD unsigned codes.
DATA REPRESENTATION CONVERSION.
Copyright (c) 2004 Professor Keith W. Noe Number Systems & Codes Part I.
Number Systems. 2 The total number of allowable symbols in a number system is called the radix or base of the system. Decimal Numbers: radix = 10 (symbols:
ECE 301 – Digital Electronics Course Introduction, Number Systems, Conversion between Bases, and Basic Binary Arithmetic (Lecture #1)
ECE 301 – Digital Electronics Number Systems and Conversion, Binary Arithmetic, and Representation of Negative Numbers (Lecture #10) The slides included.
Number System Conversions Lecture L2.2 Section 2.3.
BASICS OF COMPUTER APPLICATIONS ASB 102. UNIT 1 Introducing computer system  Number system  What is number system?  Types of number system  Their.
Real Numbers and the Decimal Number System
Supplemental Chapter Number Bases
Number System. Popular number systems Decimal. (Base 10). The system that we humans are most familiar with. Binary. (Base 2). Octal. (Base 8). Hexadecimal.
ECE 331 – Digital System Design
Number systems, Operations, and Codes
CPS120: Introduction to Computer Science Computer Math: Converting to Decimal.
Number Base Conversions
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
Chapter 1  Number Systems Decimal System Binary System Octal System Hexadecimal System  Binary weighted cods Signed number binary order  1’s and 2’s.
Digital Systems Digital Logic and Design Dr. Musab Bassam Zghool Text Book: Mano Morris M. “ Digital Logic And Computer Design ”
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
Arithmetic Chapter 4 Subject: Digital System Year: 2009.
Computer Studies Today Chapter 19 1 Chapter 19. Computer Studies Today Chapter 19 2 »Information stored in a computer is in two states: –ON –OFF.
Chapter 5 NUMBER REPRESENTATION AND ARITHMETIC CIRCUITS.
1 Digital Logic Design (41-135) Chapter 5 Number Representation & Arithmetic Circuits Younglok Kim Dept. of Electrical Engineering Sogang University Spring.
CPE 201 Digital Design Lecture 2: Digital Systems & Binary Numbers (2)
Lecturer: Santokh Singh
Chapter 2 Binary Number Systems.
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
Octal to Decimal Decimal Octal Binary Hexadecimal.
Digital Systems and Number Systems
Positional Notation A positional or place-value notation is a numeral system in which each position is related to the next by a constant multiplier, called.
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Copyright (c) 2004 Professor Keith W. Noe
Lecture 3: Binary values and number systems
CHAPTER 1 : INTRODUCTION
Introduction The term digital is derived from the way computers perform operation, by counting digits. Application of digital technology: television, communication.
COMPUTING FUNDAMENTALS
Base ‘b’ number for i = 0 to n – 1 for an n digit quantity
CSE 102 Introduction to Computer Engineering
Chapter 3 Data Representation
Number System conversions
Number Systems.
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
Wakerly Section 2.4 and further
Binary, Octal and Hex Numbers Copyright Thaddeus Konar
Binary Quiz UIN: ____________________
Data Representation Data Types Complements Fixed Point Representation
Binary, Octal and Hex Numbers Copyright Thaddeus Konar
Data Representation in Computer Systems
Numbering System TODAY AND TOMORROW 11th Edition
Numbering Systems and Arithmetic operations on Hex, binary, and octal
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
There are 10 types of people of people in this world…
Topic 3 Number Representations and Computer Arithmetics
Digital Systems and Binary Numbers
Digital Logic Design (CSNB163)
ECE 301 – Digital Electronics
Number systems and codes
Numeral systems (radix)
Remember the 10 types of people of people in this world…
Number Systems By: Asst Lec. Besma Nazar Nadhem
Homework Due Friday.
Express the fraction to decimal.
Information Representation
GCSE COMPUTER SCIENCE Topic 3 - Data 3.3 Logical and Arithmetic Shifts.
COE 202: Digital Logic Design Number Systems Part 2
Dr. Clincy Professor of CS
Chapter 1 Introduction.
Presentation transcript:

EGRE 254 Number Systems and Codes 1/12/09 Digital Logic Design EGRE 254 Number Systems and Codes 1/12/09 11/20/2018

Positional Number Systems 11/20/2018 Positional Number Systems Numbers are commonly represented in the base 10 positional number system. For example 11/20/2018

In general (see page 26) A number D of radix or base r with p digits to the left of the radix point and n digits to the right of the radix point can be expressed as: di – in base 10 di – in base r 11/20/2018

11/20/2018 Examples 156.78 = (1x102 + 5x101 + 6x100 + 7x10-1 )8 = (1x82 + 5x81 + 6x80 + 7x8-1 )10 = (64 + 40 + 6 + .875)10 = 110.87510 559 = (5x101 + 5x100)9 = (5x91 + 5x90)10 = (45 + 5)10 = 5010 1212 = (1x121 + 2x120)10 = (12 + 2)10 = 1410 101100.112 = 101100.11 = 32+8+4+.5+.25 = 44.75 11/20/2018

Examples Does r10 = 10r ? Prove it! Does rb = br ? Prove it! 11/20/2018 Examples Does r10 = 10r ? Prove it! Does rb = br ? Prove it! 111b = 13310 Find b. (41/3)b = 13b Find b. (33/3)b = 11b Find b. 1. 10r = (1 x r1 + 0 x r0)10 = r10 2. Consider 23 = 210 = 102 != 112 3. 111b = 1xb2 + 1xb1 + 1 = b2 + b + 1 = 133 b2 + b - 132 = 0 (b-11)(b+12) = 0 b = 11, b = -12 (-12)2 + (-12) + 1 = 144 – 12 + 1 Note: (12)-12 = 1x(-12)1 + 2x(-12)0 = -12 + 2 = -10. Q. What is the advantage of a number system with a negative base? We don’t need the “-” sign. 4. 4b + 1 = 3(b+3) = 3b + 9 b= 9-1 = 8 5. 3b + 3 = 3(b + 1) = 3b + b ? |b| > 3 11/20/2018

Decimal (10) Binary (2) Octal (8) Hexadecimal (16) 1 2 10 3 11 4 100 5 1 2 10 3 11 4 100 5 101 6 110 7 111 8 1000 9 1001 1010 12 A 1011 13 B 1100 14 C 1101 15 D 1110 16 E 1111 17 F 11/20/2018

Example (5D4.A2)16 = (5x102+Dx101+4+Ax10-1+2x10-2)16 = (5x162+13x161+4+10x16-1+2x16-2)10 = (1280+208+4+.625+.0078125)10 = (1492.6328125)10 11/20/2018

How do we convert from base 10 to base r? We could use previous techniques, but we would have to do arithmetic in base r. Not desirable. Consider two cases. Integer number. Fractional number. 11/20/2018

Base 10 to base r (integer case) 11/20/2018

Example – Integer to Hex 1492 = (d3 d2 d1 d0)16 = d3x163+ d2x162+ d1x16+ d0 1492/16 = 93+4/16 = d3x162+ d2x16+ d1+ d0/16 d0 = 4 93 = d3x162+ d2x16+ d1 93/16 = 5 +13/16 = d3x16+ d2+ d1/16 d1 = 1310 = D16 5 = d3x16+ d2 5/16 = 0 + 5/16 = d3 + d2/16, d3 = 0, d2 = 5 149210 = 5D416 11/20/2018

In practice You may get mixed up on direction to read the answer. 5D416 or 4D516? Note that 5D4 = 0…05D4 4D5 not same as 4D50…0 11/20/2018

Example fraction to hex (.6328125)10 = (.d-1 d-2 d-3…)16 = (d-1x16-1+ d-2x16-2+ d-3x16-3+…)10 How do we find d-1? Multiply by 16. 16 x .6328125 = 10.125 = d-1+ d-2x16-1+ d-3x16-2+… d-1 = 10 and .125 = d-2x16-1+ d-3x16-2+… Multiply by 16. Then,.125 x 16 = 2.00 = d-2+ d-3x16-1+… d-2 = 2 and d-n = 0 for n > 2. Therefore, (.6328125)10 = (.A2)16 11/20/2018

Example For a number containing both an integer and a fractional part. Compute the two parts separately and combine. 1492.632812510 = 5D4.A216 11/20/2018

Special Case converting between base r and rn Convert 132.68 to binary. Could convert to decimal and then binary. Easier way. 11/20/2018

Examples Convert (11010.11)2 to octal, and to hexadecimal. 11/20/2018 Examples Convert (11010.11)2 to octal, and to hexadecimal. (11010.11)2 = (11,010.110)2 = 32.68 (11010.11)2 = (1,1010.1100)2 =1A.C16 Convert (121.121)3 to base 9 = 32. Convert (1234.567)8 to hexadecimal. Hint 8 = 23 and 16 = 24. (1234.567)8 = (001,010,011,100.101,110,111)2 = (0010 1001 1100.1011 1011 1000)2 = (29C.BB8)16 11/20/2018

11/20/2018