Title: Example: Binary to Octal
1Example Binary to Octal
725.23 111 010 101 .
010 011
111010101.010011
2Binary to Hexadecimal
2EB9.C
2 E B 9 . C
0010 1110 1011 1001 . 1100
0010111010111001.1100
3Complements
In (R-1) Individually complement each
digit Examples base 10 90320 goes to 09679
base 2 10011 goes to 01100
base 4 32012 goes to 01321 In (R)Ignore
LSBs of zero(s) complement first non-zero digit
with (R-1) complement the rest with
(R) Examples base 10 90320 goes to 09680
base 2 10011 goes to 01101
base 4 32012 goes to 01322
4Subtraction (2s complement)
Solving for (M - N), where M 10010110 (and
M 01101010) N 01110100 (and N
10001100) (M - N) 10010110 (M) (N - M)
01110100 (N) 10001100 (N)
01101010 (M)
100100010
011011110 carry means ()
no carry means (-) answer 00100010
answer 11011110
answer (-)00100010
5Subtraction (1s complement)
M 10010110 (and M 01101001) N
01110100 (and N 10001010 (M - N)
(N - M) 10010110
(M) 01110100 (N) 10001011 (N)
01101001 (M) 100100001
011011101 1
11011101 00100010 (M - N) (-)
00100010 (-) (M- N)
6Signed Binary Numbers
Signed Magnitude ()5 (-)6 In binary
Convention is to use left bit 0 for () 1 for
(-) Example 10000110 is (-)6 Better to use
Signed Complement (say 2s complement) Steps
to accomplish 1. Express as a positive number
0000 1101 () 13 2. Take 2s complement
11110011 (-) 13
7Addition signed binary
Put negative numbers into 2s complement Add
numbers together Disregard any carry out If
answer has a 1 in the left bit, the answer is
negative (-) and you must then complement it
(sign bit and all) Example ()3 (-)7
(-)4 0000 0011 2s complement of 7 . . .
1111 1001 1111 1100 Left bit is a 1 so you
know answer is negative Take 2s complement
for answer (-) 000 0100, or (-)4
8Subtraction in signed binary
- Express all negative numbers in 2s complement
- Take 2s complement of the subtrahend
- Add the two numbers together
- Discard any carry over
- If left bit is a 0 the answer is positive
- If left bit is a 1 the answer is negative and
you must take the 2s complement to get the
answer - Example (-)7 - (-)9 1111 1001 - 1111
0111 - 1111 1001 0000 1001 1 0000 0010 ()2
9Subtraction (contd)
Now try this (-)9 - (-)7. . . And answer
better be (-)2 1111 0111 - 1111 1001 . . .
Take 2s complement of subtrahend 1111 0111
0000 0111 1111 1110 answer has a 1 in
its left bit therefore its negative take 2s
complement 0000 0010 and get (-) 2 as the
answer
10Binary Codes
- BCD
- Excess-3 84-2-1 2421 (self complementing)
- Error Detection Codes (parity)
- Gray Code
- ASCII Code
- Hollarith Code
- EBCDIC.
11Binary Storage and Registers
- Registers
- Register transfer
- Discuss Fig. 1-2
- Discuss Fig. 1-2
12Binary Logic
- AND, OR, NOT
- Truth Tables
- Switching Circuits
- Gates
- Thresholds
- Multiple inputs
- Timing Diagrams
13Laboratory Comments
- Volts, amps, ohms, watts
- VOM
- resister codes
- wire sizes
- breadboard
- equipment function generators, oscilloscopes,
etc - test probes
- report writing