You are on page 1of 15

Logic and Computer Design Fundamentals

Chapter 1 – Digital
Computers and Information

Charles Kime & Thomas Kaminski


© 2004 Pearson Education, Inc.
Terms of Use
(Hyperlinks are active in View Show mode)
Overview

 Base Conversion
 Arithmetic Operations
 Decimal Codes
 Alphanumeric Codes

Chapter 1 2
Base Conversion

Chapter 1 3
Binary To Decimal

 To convert binary to decimal, use decimal


arithmetic to form  (bit × respective power of
2).
 Example 1: Convert 110102 to N10:  

 Example 2: Convert (110101.11)2 to N10:  

Chapter 1 4
Octal To Decimal

 To convert Octal to decimal, use decimal


arithmetic to form  (digit × respective power
of 8).
 Example: Convert 7248 to N10:  

Chapter 1 5
Hexadecimal To Decimal

 To convert Hexadecimal to decimal, use


decimal arithmetic to form  (digit ×
respective power of 16).
 Example: Convert ABC16 to N10:  

Chapter 1 6
Conversion from decimal to other
Bases

 To convert from one base to another:


1) Convert the Integer Part
2) Convert the Fraction Part
3) Join the two results with a radix point

Chapter 1 7
Conversion Details from decimal to
other Bases
 To Convert the Integral Part: Repeatedly divide
the number by the new radix and save the remainders.
The digits for the new radix are the remainders in
reverse order of their computation.

 To Convert the Fractional Part: Repeatedly


multiply the fraction by the new radix and save the
integer digits that result. The digits for the new radix
are the integer digits in order of their computation.

Chapter 1 8
Decimal to Binary

 Example: Convert 46.687510 To Base 2

 Convert 46 to Base 2:

 Convert 0.6875 to Base 2:

 Join the results together with the radix


point:

Chapter 1 9
Decimal to Octal

 Example: Convert 153.51310 To Base 8

 Convert 153 to Base 8:

 Convert 0.513 to Base 8:

 Join the results together with the radix


point:

Chapter 1 10
Decimal to Hexadecimal

 Example: Convert 153.51310 To Base 16

 Convert 153 to Base 16:

 Convert 0.513 to Base 16:

 Join the results together with the radix


point:

Chapter 1 11
Octal to Binary and vice versa

 Octal to Binary:
• Restate the octal as three binary bits starting
at the radix point and going both ways.
 Binary to Octal
• Group the binary digits into three-bit groups
starting at the radix point and going both
ways, padding with zeros as needed in the
fractional part.
• Convert each group of three bits to an octal
digit.

Chapter 1 12
Hexadecimal to Binary and vice versa

 Hexadecimal to Binary:
• Restate the hexadecimal as four binary digits
starting at the radix point and going both
ways.
 Binary to Hexadecimal:
• Group the binary digits into four-bit groups
starting at the radix point and going both
ways, padding with zeros as needed in the
fractional part.
• Convert each group of three bits to a
hexadecimal digit.

Chapter 1 13
Octal to Hexadecimal (via Binary)

 Convert octal to binary.


 Use groups of four bits and convert as above to
hexadecimal digits.
 Example: Octal to (Binary to) Hexadecimal
(6 3 5 . 1 7 7 ) 8

Chapter 1 14
Hexadecimal to Octal (via Binary)

 Convert Hexadecimal to binary.


 Use groups of three bits and convert as above to
Octal digits.
 Example: Hexadecimal to Binary to Octal
1 9 D . 3 F 816

Chapter 1 15

You might also like