Title: Logic Circuits
1Logic Circuits
- More on Logic Gates and Boolean Expressions
Contrariwise, continued Tweedledee, if it was
so, it might be and if it were so, it would be
but as it isnt, it aint. Thats logic. -Lewis
Carroll, Alices Adventures in Wonderland, 1865
2Arithmetic Circuits
- Arithmetic operations can be represented as
Boolean expressions, so hardware circuits can be
built to add, subtract, multiply, and divide two
numbers - Numbers are represented in binary form, which we
will discuss further in the next lecture
3Circuit Simulator
- There are a few circuit simulators available from
other universities online to explore some of
these concepts. One is located at - http//www.math-cs.gordon.edu/courses/cs111/module
7/logic-sim/example1.html
4Memory Circuits
- So, whats so special about all this?
- Boolean logic allows for the creation of
circuits that remember their previous state.
These are called flip flops and are discussed
in the text. - We will study the flip-flop example in the text,
Fig 1.3., Page 22.
5Flip-Flop Circuit
Figure 1.3A simple flip-flop circuit
6Manipulating output from flip-flop
Figure 1.4 (A)Setting the output of a flip-flop
to 1
7Setting the output of a flip-flop
Figure 1.4 (B)Setting the output of a flip-flop
to 1
8Output remains 1
Figure 1.4 (C)Setting the output of a flip-flop
to 1
9Exercises
- We will work on
- Setting up Boolean Expressions from problem
statements - Reducing Boolean Expressions to determine output
- Stepping through given logic circuits to
determine outputs for given inputs
10Boolean Expressions
- Example 1
- To get into a physics program in a university,
Jane needs to have (University-Level) UL-Physics
and either UL-Algebra or UL-Calculus. Assign
Boolean variables to the conditions and write a
Boolean expression for the physics program
requirements. - To get you started
- Let P represent whether Jane has UL-physics,
- Let A represent whether Jane has UL-algebra,
- Let C represent whether Jane has UL-calculus.
11Boolean Expressions Example 1
To get into a physics program in a university,
Jane needs to have (University-Level) UL-Physics
and either UL-Algebra or UL-Calculus. Assign
Boolean variables to the conditions and write a
Boolean expression for the physics program
requirements.
- P and (A or C)
- (P and A) or (P and C)
12Evaluate the Expressions
- A 1, B 0, C 1, D 0, E 1
- (A and B)
- (A or B)
- (A or D) and C
- (C and A and D) or E
- (C and A and D) and E
- Note C is not(C)
13Expressions Answers
- A 1, B 0, C 1, D 0, E 1
- (A and B) 1 AND 0 0
- (A or B) 1 OR 0 1
- (A or D) and C (1 OR 0) AND 1 1
- (C and A and D) or E (1 AND 1 AND 0) OR 1 1
- (C and A and D) and E (0 AND 1 AND 1) AND 1
0
14Alarm System
- You are installing an alarm system in a house.
The system has a panel with an on/off switch. If
the system (panel switch) is off then the alarm
will never sound. If the system is on, then the
alarm will sound if the door sensor detects a
problem or if the window sensor detects a
problem. - Can you write a Boolean expression for
determining if the alarm is on (true) or off
(false)?
15Alarm System
- Assume
- A 0panel switch off, 1panel switch on
- B 0no door problem, 1problem at door
- C 0no window problem, 1problem at window
- Logic
- IF A1 THEN
- IF B1 OR C1 THEN Z1 ELSE Z0
- Expression
- Z A and (B or C)
16Car Buzzer
- You are designing a system for allowing buzzer to
be turned on in a car. If the car is turned off,
then the buzzer should not function. If the car
is turned on, and the door is open, or, the
seat-belt is not fastened, the buzzer should be
turned on or, if the car is turned on and if the
trunk is not shut, or the fuel tank cap is not
shut, the buzzer should be turned on.
17Car Buzzer
- A 0Car off, 1Car on
- B 0Door closed, 1 Door open
- C 0Seat-belt not fastened, 1Seat-belt fastened
- D 0Trunk closed, 1Trunk open
- E 0Fuel-tank cap closed, 1Fuel-tank cap open
18Car Buzzer
- One answer is
- Z (A and (B or C)) or (A and (D or E))
19Logic Circuits
- Question 1
- The given circuit has 3 logic gates AND, NOT,
XOR. For what values of inputs A, B is the output
1?
20Logic Circuits
21Logic Circuits
- Question 2
- The given circuit has 3 logic gates AND, OR,
XOR. For what values of the inputs A, B, C is the
output 1?
22Logic Circuits