Beruflich Dokumente
Kultur Dokumente
iClicker frequency BB
Minnes (CSE20)
6/3/2013
1 / 14
Todays topics
Logic gates
Converting between propositions and hardware
Computer arithmetic
Adding two 1-digit binary numbers Adding two 4-digit binary numbers
Minnes (CSE20)
6/3/2013
2 / 14
Minnes (CSE20)
6/3/2013
3 / 14
Example: implication
How do we implement the implication connective in hardware? Recall: pq Try to draw it! p q
Minnes (CSE20)
6/3/2013
4 / 14
Minnes (CSE20)
6/3/2013
5 / 14
Review: DNF
What hardware logic implements this truth table? p T T T T F F F F q T T F F T T F F r T F T F T F T F ? T F F T F T F T
Minnes (CSE20)
6/3/2013
6 / 14
Review: DNF
What hardware logic implements this truth table? p T T T T F F F F q T T F F T T F F r T F T F T F T F ? T F F T F T F T
Minnes (CSE20)
6/3/2013
7 / 14
DNF is (p q r ) (p q r ) (p q r ) (p q r ) Which hardware logic works? Try to draw it ! Using 2-input gates for 3-input propositions: Theorem. p q r = p (q r ) Associativity
Minnes (CSE20)
6/3/2013
7 / 14
Computer arithmetic
When realize logic propositions/ calculations on a computer, need to implement using gates and voltages. Binary values: 0 and 1
Minnes (CSE20)
6/3/2013
8 / 14
Computer arithmetic
When realize logic propositions/ calculations on a computer, need to implement using gates and voltages. Binary values: 0 and 1 Interpretation of these values depends on context? In Logic:
1b = True 0b = False
Minnes (CSE20)
6/3/2013
9 / 14
If n = 1, put a 1 in the 0 place of the binary representation. Put 0s in all places that havent been set to 1. If N = 0, erase all leading 0s. If N = 0, erase all but one 0s.
Minnes (CSE20)
6/3/2013
10 / 14
If n = 1, put a 1 in the 0 place of the binary representation. Put 0s in all places that havent been set to 1. If N = 0, erase all leading 0s. If N = 0, erase all but one 0s. What is binary representation of 17d ? A. 17b B. 10b C. 101b
Minnes (CSE20) 6/3/2013 10 / 14
Carry is when the sum in one column exceeds the maximum digit Max digit in decimal is 9 Max digit in binary is 1 and must overow into the next column.
Minnes (CSE20)
6/3/2013
11 / 14
Carry is when the sum in one column exceeds the maximum digit Max digit in decimal is 9 Max digit in binary is 1 and must overow into the next column. In decimal: e.g. 5823 +3 5 5 1
Minnes (CSE20)
6/3/2013
11 / 14
Carry is when the sum in one column exceeds the maximum digit Max digit in decimal is 9 Max digit in binary is 1 and must overow into the next column. In decimal: e.g. 5823 +3 5 5 1 9374
Minnes (CSE20)
6/3/2013
11 / 14
Minnes (CSE20)
6/3/2013
11 / 14
Double check
In previous examples, what are numbers in decimal?
1101b +0 1 1 0 b 10011b A. 110d + 110d = 100011d B. 12d + 4d = 16d C. 15d + 8d = 23d *D. 13d + 6d = 19d E. None of the above.
Minnes (CSE20)
6/3/2013
12 / 14
Can represent each column in the long addition of binary number using a truth table: p 0 0 1 1 q 0 1 0 1 Will we have a carry? p+q
Minnes (CSE20)
6/3/2013
13 / 14
Can represent each column in the long addition of binary number using a truth table: p 0 0 1 1 q 0 1 0 1 Will we have a carry? 0 0 0 p+q 0 1 1
Minnes (CSE20)
6/3/2013
13 / 14
Can represent each column in the long addition of binary number using a truth table: p 0 0 1 1 q 0 1 0 1 Will we have a carry? 0 0 0 1 p+q 0 1 1 0
Minnes (CSE20)
6/3/2013
13 / 14
Can represent each column in the long addition of binary number using a truth table: Which hardware implements addition? Carry: p q Sum: p q (XOR)
Minnes (CSE20)
6/3/2013
13 / 14