CS 126 Lecture A3: Boolean Logic
CS126 11-1 Randy Wang
Outline
- Introduction
- Logic gates
- Boolean algebra
- Implementing gates with switching devices
- Common combinational devices
- Conclusions
CS 126 Lecture A3: Boolean Logic Outline Introduction Logic gates - - PDF document
CS 126 Lecture A3: Boolean Logic Outline Introduction Logic gates Boolean algebra Implementing gates with switching devices Common combinational devices Conclusions CS126 11-1 Randy Wang Where We Are At We have
CS126 11-1 Randy Wang
CS126 11-2 Randy Wang
machine: the instruction set architecture
interface:
CS126 11-3 Randy Wang
beyond just computers.
systems in life (data processing, control systems, communications, measurement, ...)
CS126 11-4 Randy Wang
circuit Circuit x1 x2 xm
Inputs
z1 z2 zn
Outputs
CS126 11-5 Randy Wang
CS126 11-6 Randy Wang
CS126 11-7 Randy Wang
1 1 1 1 1 1 1 1 1
CS126 11-8 Randy Wang
gates
rewind button(remote) rewind button (VCR) start of tape reached rewind tape
CS126 11-9 Randy Wang
above circuits turn out to be the same!)
formalism
x y ? x y x
CS126 11-10 Randy Wang
CS126 11-11 Randy Wang
problems
boolean variables
CS126 11-12 Randy Wang
possible combination of input values
CS126 11-13 Randy Wang
CS126 11-14 Randy Wang
arbitrary boolean functions [such as g(x,y)=xy+z’] x y x y x
AND(x,y)=xy=x*y
OR(x,y)=x+y NOT(x)=x’
CS126 11-15 Randy Wang
two ways: truth table and composition of basic functions
simplification)
CS126 11-16 Randy Wang
Gluing the truth tables of all functions of two variables into one table For n variables, there are a total of functions!
CS126 11-17 Randy Wang
CS126 11-18 Randy Wang
CS126 11-19 Randy Wang
CS126 11-20 Randy Wang
CS126 11-21 Randy Wang
simplify circuits
x y ? x y x
CS126 11-22 Randy Wang
represent output signals with output boolean variables
do
basic boolean functions with primitive gates
CS126 11-23 Randy Wang
CS126 11-24 Randy Wang
are relays, diodes, transistors, and magnetic cores
together transistors
Main input (M) Controlled input (C) Output (O) O = M C’
C 1 1 M 1 1 O 1
CS126 11-25 Randy Wang
CS126 11-26 Randy Wang
(DeMorgan’s Law)
CS126 11-27 Randy Wang
CS126 11-28 Randy Wang
CS126 11-29 Randy Wang
x y z d0=x’y’z’ d1=x’y’z d2=x’yz’ d3=x’yz d4=xy’z’ d5=xy’z d6=xyz’ d7=xyz 3-8 decoder
example: if x,y,z = 1,0,1
d5=1 di=0 elsewhere
CS126 11-30 Randy Wang
d0=x’y’z’ d1=x’y’z ......
x 1 1 1 1 y 1 1 1 1 z 1 1 1 1 d0 1 x 1 1 1 1 y 1 1 1 1 z 1 1 1 1 d1 1
CS126 11-31 Randy Wang
CS126 11-32 Randy Wang
CS126 11-33 Randy Wang
and are interpreted together as one binary number
8-1 MUX I0 I1 I2 I3 I4 I5 I6 I7 x y z
M
CS126 11-34 Randy Wang
M=x’y’z’I0 + x’y’zI1 +...+ xyzI7
expression instead of starting with a truth table
x ... 1 1 y ... 1 1 z 1 1 ... 1 1 I7 ... 1 ... ... ... ... ... ... ... ... I1 1 ... I0 1 ... M 1 1 ... 1
CS126 11-35 Randy Wang
+ xy’z’I4 + xy’zI5 + xyz’I6 + xyzI7
z y x I0 I1 I7
M
CS126 11-36 Randy Wang
s c
CS126 11-37 Randy Wang
parity circuit and majority circuit
CS126 11-38 Randy Wang
+
CS126 11-39 Randy Wang
CS126 11-40 Randy Wang
1-bit adder
majority parity
x y x y x
Gates
All the lessons that we learned for ADT apply here to hardware as well!
transistors
CS126 11-41 Randy Wang
components such as resistors, diodes, and transistors to form logic building blocks
building blocks such as logic gates and flip-flops to form subsystems
number, type, and interconnection of subsystems such as memory units, ALUs, and I/O devices
CS126 11-42 Randy Wang
are made