Download as ppsx, pdf, or txt
Download as ppsx, pdf, or txt
You are on page 1of 11

Topic 2: Number Systems

(part 1)
Digital Systems I

Omid Fatemi

Omid Fatemi Number Systems 1


From Switches to Systems - Review
Hierarchical system
structure
Verilog description
language
Digital design flow
Now: Binary system
Omid Fatemi Number Systems 2
Outline
Why Binary?
Decimal and Binary
Hex and Octal
Coding System
Binary arithmetic

Omid Fatemi Number Systems 3


Why Binary?
Computers don’t understand words or
numbers the way humans do.
In the lowest level, computers work with
0 and 1.
Binary number is base 2.

Slide from Dr. Zainalabedin Navabi


Omid Fatemi Number Systems 4
Decimal and Binary
Decimal Numbers

Decimal Point
Binary Point
-1 -3−𝟑 -4
𝟒4 𝟑
3 𝟐
2 1 𝟏 𝟎 −𝟏 -2
−𝟐 −𝟒
𝟏𝟎2 𝟏𝟎2
0
𝟏𝟎2 𝟏𝟎 𝟏𝟎2 𝟏𝟎2 𝟏𝟎2
2 𝟏𝟎
2 𝟏𝟎2
2 5 . 1 3
25.13= 2*101 +5*100 + 1*10-1+3*10-2

Integer Fraction

Slide from Dr. Zainalabedin Navabi


Omid Fatemi Number Systems 5
Decimal and Binary
Binary Numbers

Binary Point
4 3 2 1 0 -1 -2 -3 -4

2 2 2 2 2 2 2 2 2

1 1 0 0 1 . 0 0 1 0
(11001.1010)2 = 1*24 + 1*23 +0*22 + 0*21 +1*20 + 0*2-1+0*2-2+ 1*2-3+0*2-4 = (25.125)10
Integer Fraction

Binary to decimal conversion

Number Systems

Slide from Dr. Zainalabedin Navabi


Omid Fatemi 6
Decimal and Binary
Decimal to Binary Conversion (Integer
Part)
(29.61)10=(?)2

29 = (?)2
Succesive
subtraction
Remember the power of 2s:
128 64 32 16 8 4 2 1
29 – 16 = 13, 13 – 8 = 5, 5 – 4 = 1, 1 -1 = 0
128 64 32 16 8 4 2 1  00011101
Slide from Dr. Zainalabedin Navabi
Omid Fatemi Number Systems 7
Decimal and Binary
Decimal to Binary Conversion (Integer
Part)
(29.61)10=(?)2

Successive divisions and collecting the


remainders, the first remainder is the
nearest digit to the binary point.
14 07 03 1
2 29 2 14 2 07 2 03
28 14 06 02
1 0 1 1

(29)D = (11101.)B
Slide from Dr. Zainalabedin Navabi Binary point
Omid Fatemi Number Systems 8
Decimal and Binary
Decimal to Binary Conversion (Fractional
Part)
Use multiplication to find the fractional
part.
0.61*2 = 1 . 22
0.22*2 = 0 . 44
0.44*2 = 0 . 88 (29.61)10=(11101.100111)2
(0.61)10=(.100111)2
0.88*2 = 1 . 76
0.76*2 = 1 . 52
0.52*2 = 1 . 04

Slide from Dr. Zainalabedin Navabi


Omid Fatemi Number Systems 9
Topic 2: Number Systems
(end of part 1)
Digital Systems I

Activities – reflection and online quiz in the class


Omid Fatemi

Omid Fatemi Number Systems 10


Thank you – Any comments?

Omid Fatemi
ofatemi@uottawa.ca

Omid Fatemi Number Systems 11

You might also like