Professional Documents
Culture Documents
Untitled
Untitled
Examples
6 x 82 = 6 x 64 = 384
+ 4 x 81 = 4 x 8 = 32
+ 2 x 8º = 2 x 1 = 2
= 418 in base 10
Converting Hexadecimal to Decimal
What is the decimal equivalent of the hexadecimal
number DEF?
Try a Conversion
D E F
Converting
Decimal → Binary
59.7510 = 5910 + 0.7510
Wholepart
2 59 1 (remainder of 59 divide 2)
2 29 1 (remainder of 29 divide 2)
2 14 0 (remainder of 14 divide 2)
2 7 1 (remainder of 7 divide 2)
2 3 1 (remainder of 3 divide 2)
1 → 5910 = 1110112
Converting
Fractional part
multiply 2, take the first number before point
until cycle or zero
0.75 * 2 = 1.5 → 1
0.50 * 2 = 1.0 → 1
0.7510 = 0.1102
Merge whole part and fractional part →
59.7510 = 111011.112
Converting
Decimal → Octal
Same as Decimal → Binary
whole part: divide 2 → divide 8
Decimal → Hexadecimal
Same as Decimal → Binary
whole part: divide 2 → divide 16
4877.1562510 = 130D.2816
Converting
Octal / Hexadecimal → Binary
5 7 6 2. 1 38 = 101 111 110 010. 001 0112
Low Voltage = 0
High Voltage = 1 all bits have 0 or 1
Binary and Computers
Byte = 8 bits
The number of bits in a word determines the word
length of the computer, but it is usually a multiple of
8
32-bit machines
64-bit machines etc
Binary Systems
Complements
Diminished radix complement: (r-1)’s complement
A number N in base r having n digitals
(r-1)’s complement =
(r n 1) N
Ex.
9’s complement of 546700 is 999999-546700 = 453299
r’s complement = 0 , if N 0
n
r N , if N 0
Ex.
10’s complement of 012398 is 987602
Arithmetic Subtraction
(±A) – (+B) = (±A) + (-B)
(±A) – (-B) = (±A) + (+B)
Binary Systems
Binary Codes
BCD code
2421 code
Excess-3 code
8 4-2-1 code
Gray code
ASCII code
Binary Systems
BCD code (Binary Coded Decimal )
Represent the decimal digits by means of a code that
contains 1’s and 0’s.
4-bit code ← 24 > 10 (0, 1, 2, 3, 4, …, 9)
Binary Systems
(185)10 = (0001 1000 0101)BCD = (10111001)2
Addition
When the binary sum of two BCD numbers is greater than or
equal to 1010, it need to add 6 = (0110)2 to the binary sum to
correct the sum and get a carry
Binary Systems
4 0100 4 0100 8 1000
+5 +0101 +8 +1000 +9 +1001
9 1001 12 1100 17 10001
+0110 +0110
10010 10111
Binary Systems
Subtraction
Using 10’s complement of a BCD
(+375) + (-240) = +135
Self-complementing codes
9’s complement of a decimal number is 0 ←→ 1
2421 / Excess-3
Binary Systems
Gray code
Convenient for continuous
information
Only one bit changes in value
during any transition between
two neighbor numbers
Binary Systems
Alphanumeric characters
ASCII (American Standard Code for Information
Interchange)
7 bits for 128 characters
94 graphic characters that can be printed
34 non printing characters for control functions
Format effectors
Information separators
Record separator
Communication-control characters
Register transfer
A transfer of binary information from one set of register into
another set of registers
Binary Systems
Binary Systems
Adding two 10-bit binary number
Binary Systems
Binary Logic
Two discrete values, 0/1, true/false
Definition
Binary logic consists of binary variables and logical operations
AND / OR / NOT
True Tables
Logic gate
Voltage-operated circuits respond to two separate voltage levels
(0/1)
Binary Systems
Binary Systems
State transition
0 1 0
Binary Systems