0% found this document useful (0 votes)
123 views30 pages

COMP4009 - 2019-20-W04 - Computing - Logic PDF

This document provides an overview of computing logic for a university course. It discusses: - The learning outcomes, which are to identify basic logic gates, combine gates into circuits, and describe gate/circuit behavior using Boolean expressions, truth tables, and logic diagrams. - The basic AND, OR, and NOT gates. - How gates are combined into combinational circuits and described using truth tables, Boolean expressions, and logic diagrams. - Tools for analyzing circuits like Logisim software for drawing circuits and simulating/minimizing their behavior. - Assignments including practical exercises and a coursework to design a logic circuit.

Uploaded by

Medo 86
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views30 pages

COMP4009 - 2019-20-W04 - Computing - Logic PDF

This document provides an overview of computing logic for a university course. It discusses: - The learning outcomes, which are to identify basic logic gates, combine gates into circuits, and describe gate/circuit behavior using Boolean expressions, truth tables, and logic diagrams. - The basic AND, OR, and NOT gates. - How gates are combined into combinational circuits and described using truth tables, Boolean expressions, and logic diagrams. - Tools for analyzing circuits like Logisim software for drawing circuits and simulating/minimizing their behavior. - Assignments including practical exercises and a coursework to design a logic circuit.

Uploaded by

Medo 86
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

COMP4009 - Foundations of Computer Systems

Week 4 – Computing Logic

Dr Shumao Ou
[email protected]
E202, x4508
Learning Outcome for this lecture

• This week we will see:


• How to identify the basic gates and describe the behaviour
of them
• To combine basic gates into circuits
• How to describe the behaviour of a gate or circuit using
Boolean expressions, truth tables, and logic diagrams

• Reading Material
• CS illuminated, Chapter 4
• Lipschutz, Essential Computer Mathematics, Chapters 7
and 8
• Code’s book, Chapters 10 and 11
Layers of a Computing System
Logic Level

• Lowest level we look at, below this is electronics and physics


• At the logic level we describe what is happening to individual
bits of information. How do the bits being

• Stored
• Moved
• Modified
Gates and Circuits
Gate
• A device performs a basic
operation on electrical signals
• Gates are electronic devices
used to operate with bits
• Basic gate operations are
boolean logical operation
• And
• Or
• Not
• …
Circuits
• Gates combined to perform
more complicated tasks
• E.g. Add two numbers
Logic Description

• How do we describe the behavior of gates and circuits?

• Boolean expressions
• Uses Boolean algebra, a mathematical notation for expressing two-
valued logic

• Logic diagrams

• A graphical representation of a circuit; each gate has its own symbol

• Truth tables

• A table showing all possible input value and the associated output
values
Gates

• Three main gates


• AND
• OR
• NOT

• Other useful gates
• NAND
• NOR
• XOR
AND Gate

• An AND gate accepts two input signals


• If both are 1 the output is 1, otherwise the output is 0

X  A B
X = A and B
X = AB
OR Gate

• An OR gate accepts two input signals


• If both are 0 the output is 0, otherwise the output is 1

X  A B
X= A or B
NOT Gate

• A NOT gate accepts one input signal (0 or 1) and returns the


opposite signal as output

XA
X = not A X = ~A
XOR Gate

• An XOR (eXclusive OR) gate accepts two input signals


• If both are the same the output is 0, otherwise the output is 1
XOR Gate

• Note the difference between the XOR gate and the OR gate; they
differ only in one input situation
• When both input signals are 1, the OR gate produces a 1 while the
XOR produces a 0

• XOR is called the exclusive OR gate

OR XOR
NAND Gate

• The NAND gate accepts two input signals


• If both are 1 the output is 0, otherwise the output is 1

X  A B
X  AB
NOR Gate

• The NOR gate accepts two input signals


• If both are 0 the output is 1, otherwise the output is 0

X  A B
X  A B
Review of Gate Processing

• A NOT gate inverts its single input


• An AND gate produces 1 if both input values are 1
• An OR gate produces 0 if both input values are 0
• An XOR gate produces 0 if input values are the same
• A NAND gate produces 0 if both inputs are 1
• A NOR gate produces a 1 if both inputs are 0
Circuits

• Combinational circuit
• The input values explicitly determine the output

• Sequential circuit
• The output is a function of the input values and the existing state of
the circuit (sequential circuits are not covered in this module)

• We describe the circuit operations using


Boolean expressions
Logic diagrams
Truth tables
Combinational Circuits

• Gates are combined into circuits by using the output


of one gate as the input for another

X=AB +AC
D=AB
E=AC
X=D+E
Combinational Circuits

X=AB +AC

• Three inputs require eight rows to describe all possible input


combinations
• This same circuit using a Boolean expression is (AB + AC)
A circuit to add
X= A’B + AB’
• Adding two binary bits X  A B  AB
• 0+0=0
• 0+1=1
• 1+0=1
• 1+1=0
We can write this in a
different format:

INPUT OUTPUT
A B X
0 0 0 A
Q: How can we read 0 1 1 Truth
this to build a circuit? 1 0 1 table
1 1 0
A circuit to add

A B  AB

INPUT OUTPUT
A B X
0 0 0 A
0 1 1 Truth
1 0 1 table
1 1 0
Logic functions

• We describe the function of gates and circuits using


• Truth tables
• Boolean algebra X=(A+B) . (A+B’)
• logic diagrams
OR
AND

NOT OR
Truth Tables
•Given a circuit we can construct
a truth table by listing all possible
combinations of input and all the
intermediate results of the gates,
finally showing the output

A B B (A+B) A  B ( A  B)  ( A  B )
Truth Tables
•Given a circuit we can construct
a truth table by listing all possible
combinations of input and all the
intermediate results of the gates,
finally showing the output

A B B (A+B) A  B ( A  B)  ( A  B )
0 0 1 0 1 0

0 1 0 1 0 0

1 0 1 1 1 1

1 1 0 1 1 1
Truth Tables

• (A+B) C

A B C A+B (A+B)C
0 0 0 0 0
0 0 1 0 0
0 1 0 1 0
0 1 1 1 1
1 0 0 1 0
1 0 1 1 1
1 1 0 1 0
1 1 1 1 1
Derive Boolean Expression
Rules to derive Boolean expression from Truth Tables
• Given the truth table with its inputs and outputs:
1. Consider the rows of the truth table where output is 1
2. For each output 1 row, write a Boolean expression
containing the input variables connected with AND operators
(.) If the value of the input is 0, the input will appear inverted.
3. Combine all the expressions by using OR operators (+)

A B X
0 0 0
0 1 1  A’.B
1 0 1  A.B’
1 1 0

So X = A’.B + A.B’
To analyse a truth table we use
Boolean Algebra

• Similar to algebra with real numbers


• familiar operations + - * /
• new operations are . + ¯ (and, or, not)

• There are fundamental properties, laws and theorems used to


simplify complex expressions
Logisim Software

• Logisim is a freeware for drawing


circuits
• Given a circuit it can help us to:
• Simulate the circuit
• Analyse the truth table
• Minimise the expression
• A version for windows can be downloaded from
Moodle
• For other OS see website
http://www.cburch.com/logisim/
Logisim Software

At Brookes:
• Download Logisim from the link on
Moodle to your H drive and run

At Home:
• You may need to install Java first
• Excellent tutorial at:
http://www.cburch.com/logisim/docs/2.7/en/html/g
uide/tutorial/index.html
• And
https://www.youtube.com/watch?v=cMz7wyY_Px
E
Conclusion

• Logic gates are used to construct circuits


• Circuits carry out many functions inside the different
units of the processor
• To construct a circuit we may start with an expression
or a truth table
• From the circuit we can also infer the Boolean
expression
Week 4 Practical and Coursework 1

• Week 4 Practical Lab and Homework


• Part 1 – Learn to use Logisim software
• Part 2 – Exercises to be done during the practical
• Part 3 – More exercises
• Write your solutions for Part 2 & 3 in a Word or
PDF and submit it to Moodle by Friday at 5pm

• Coursework 1 – Design a Logic Circuit


• Due on Friday (Week 6) at 12noon

30

You might also like