Docsity

Decimal Binary Conversion - Digital Logic Design - Lecture Slides, Slides of Digital Logic Design and Programming

Partial preview of the text

Download Decimal Binary Conversion - Digital Logic Design - Lecture Slides and more Slides Digital Logic Design and Programming in PDF only on Docsity!

Lecture No. 2

Number Systems

Recap

Last lecture discussion

 Decimal Number Systems

 Caveman Base 5 Number System

 Binary Number System

 Number System Conversion

Today’s lecture discussion

 Decimal-Binary Conversion

Binary to Decimal Conversion

 Sum-of-Weights

 (^10011 )

 (1 x 2^4 ) + (0 x 2^3 ) + (0 x 2^2 ) + (1 x 2^1 )

  • (1 x 2^0 )

 Terms 16, 0, 0, 2 and 1

 19

Binary to Decimal Conversion

 Add weights of non-zero terms

 Weights increase/decrease by power of 2

 10011 2 = 16 + 2 + 1 = 19

 1011.101 2 = 8 + 2 + 1 + 1/2 + 1/

= 11 + 5/ = 11.

Decimal to Binary Conversion

using Sum-of-Weights

number Weight Result after subtraction Binary Bit 392 256 392-256 = 136 1 b 8 136 128 136-128 = 8 1 b 7 8 64 0 b 6 8 32 0 b 5 8 16 0 b 4 8 8 8-8 =0 1 b 3 0 4 0 b 2 0 2 0 b 1 0 1 0 b 0

Decimal to Binary Conversion

number Quotient after division Remainder after division 392 196 0 (b 0 ) 196 98 0 (b 1 ) 98 49 0 (b 2 ) 49 24 1 (b 3 ) 24 12 0 (b 4 )

12 6 0 (b 5 ) 6 3 0 (b 6 ) 3 1 1 (b 7 ) 1 0 1 (b 8 )

Decimal-Binary fraction

conversion

 Decimal to Binary Conversion

 Repeated multiplication by 2

Number Mult. By 2 Integer

0.8125 1.625 1 (b (^) -1 ) 0.625 1.250 1 (b (^) -2 ) 0.250 0.500 0 (b (^) -3 ) 0.500 1.000 1 (b (^) -4 )

Binary Arithmetic

 Binary Addition

 Binary Subtraction

 Binary Multiplication

 Binary Division

Binary Addition

Binary Subtraction

 Four Basic rules for binary subtraction

1 st^ digit 2 nd^ digit Difference Borrow 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0 0

Binary Multiplication

 Four Basic rules for binary multiplication

1 st^ digit 2 nd^ digit Product 0 0 0 0 1 0 1 0 0 1 1 1

 Example of Binary Multiplication

Binary Multiplication

x 101 (5)

1 st^ product term 1101

2 nd^ product term 0000

3 rd^ product term 1101

Product 1000001 (65)

Binary Division

Division by shifting right

 Decimal 29 shifted right by one digit

 2.

 Shift left 1 digit is divide by 10

 Binary 11101 2 (29) shifted left by one bit

 1110.1 2 (14.5)

 Shift left 1 bit is divide by 2