Lecture 2
Lecture 2
Chapter 1 – Digital
Computers and Information
Base Conversion
Arithmetic Operations
Decimal Codes
Alphanumeric Codes
Chapter 1 2
Base Conversion
Chapter 1 3
Binary To Decimal
Chapter 1 4
Octal To Decimal
Chapter 1 5
Hexadecimal To Decimal
Chapter 1 6
Conversion from decimal to other
Bases
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.
Chapter 1 8
Decimal to Binary
Convert 46 to Base 2:
Chapter 1 9
Decimal to Octal
Chapter 1 10
Decimal to Hexadecimal
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)
Chapter 1 14
Hexadecimal to Octal (via Binary)
Chapter 1 15