Professional Documents
Culture Documents
Introduction
Binary Quantities and Variables
Logic Gates
Boolean Algebra
Combinational Logic
Number Systems and Binary Arithmetic
Numeric and Alphabetic Codes
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.1
Introduction 9.1
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.2
Binary Quantities and Variables 9.2
S L
OPEN OFF
CLOSED ON
S L
0 0
1 1
A simple binary arrangement
A truth table
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.3
A binary arrangement with two switches in series
L = S1 AND S2
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.4
A binary arrangement with two switches in parallel
L = S1 OR S2
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.5
Three switches in series
L = S1 AND S2 AND S3
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.6
Three switches in parallel
L = S1 OR S2 OR S3
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.7
A series/parallel arrangement
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.9
Logic Gates 9.3
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.11
The OR gate
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.12
The NOT gate (or inverter)
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.13
A logic buffer gate
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.14
The NAND gate
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.15
The NOR gate
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.16
The Exclusive OR gate
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.17
The Exclusive NOR gate
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.18
Boolean Algebra 9.4
Boolean Constants
these are 0 (false) and 1 (true)
Boolean Variables
variables that can only take the vales 0 or 1
Boolean Functions
each of the logic functions (such as AND, OR and
NOT) are represented by symbols as described above
Boolean Theorems
a set of identities and laws see text for details
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.19
Boolean identities
AND Function OR Function NOT function
00=0 0+0=0 0 1
01=0 0+1=1 1 0
10=0 1+0=1 AA
11=1 1+1=1
A0=0 A+0=A
0A=0 0+A=A
A1=A A+1=1
1A=A 1+A=1
AA=A A+A=A
A A 0 A A 1
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.20
Boolean laws
Commutative law Absorption law
AB BA A AB A
AB B A A( A B ) A
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.21
Combinational Logic 9.5
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.23
Implementing a function from a Boolean expression
Example see Example 9.2 in the course text
Implement the function Y AB CD
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.24
Generating a Boolean expression from a logic
diagram
Example see Example 9.3 in the course text
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.25
Example (continued)
work progressively from the inputs to the output adding
logic expressions to the output of each gate in turn
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.26
Implementing a logic function from a description
Example see Example 9.4 in the course text
The operation of the Exclusive OR gate can be stated as:
The output should be true if either of its inputs are true,
but not if both inputs are true.
This can be rephrased as:
The output is true if A OR B is true,
AND if A AND B are NOT true.
We can write this in Boolean notation as
X ( A B) ( AB)
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.27
Example (continued)
The logic function
X ( A B) ( AB)
can then be implemented as before
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.28
Implementing a logic function from a truth table
Example see Example 9.6 in the course text
Implement the function of the following truth table
A B C X first write down a Boolean
0 0 0 0 expression for the output
0 0 1 1 then implement as before
0 1 0 0
in this case
0 1 1 0
1 0 0 0 X A BC ABC A BC
1 0 1 1
1 1 0 1
1 1 1 0
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.29
Example (continued)
The logic function X A BC A BC AB C
can then be implemented as before
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.30
In some cases it is possible to simplify logic
expressions using the rules of Boolean algebra
Example see Example 9.7 in the course text
X ABC A BC AC A C can be simplified to X BC A
hence the following circuits are equivalent
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.31
Number Systems and Binary Arithmetic 9.6
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.32
Number conversion
conversion to decimal
add up decimal equivalent of individual digits
Example see Example 9.8 in the course text
Convert 110102 to decimal
110102 = (1 24) + (1 23) + (0 22) + (1 21) + (0 20)
= 16 + 8 + 0 + 2 + 0
= 2610
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.33
Number conversion
conversion from decimal
repeatedly divide by the base and remember the remainder
Example see Example 9.9 in the course text
Convert 2610 to binary
Number Remainder
Starting point 26
2 13 0
2 6 1
2 3 0
2 1 1
2 0 1
read number from this end
=11010
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.34
Binary arithmetic
much simpler than decimal arithmetic
can be performed by simple circuits, e.g. half adder
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.35
More complex circuits can add digital words
Similar circuits can be
constructed to perform
subtraction see text
More complex arithmetic
(such as multiplication and
division) can be done by
dedicated hardware but is
more often performed using a
microcomputer or complex
logic device
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.36
Numeric and Alphabetic Codes 9.7
Decimal Binary
Binary code
0 0
by far the most common 1 1
way of representing 2 10
3 11
numeric information 4 100
5 101
has advantages of 6 110
simplicity and efficiency of 7 111
8 1000
storage 9 1001
10 1010
11 1011
12 1100
etc. etc.
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.37
Numeric and Alphabetic Codes 9.7
Decimal Binary
Binary-coded decimal code
0 0
formed by converting each 1 1
digit of a decimal number 2 10
3 11
individually into binary 4 100
requires more digits than 5 101
6 110
conventional binary 7 111
8 1000
has advantage of very easy 9 1001
conversion to/from decimal 10 10000
11 10001
used where input and output 12 10010
are in decimal form etc. etc.
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.38
Numeric and Alphabetic Codes 9.7
ASCII code
American Standard Code for Information Interchange
an alphanumeric code
each character represented by a 7-bit code
gives 128 possible characters
codes defined for upper and lower-case alphabetic characters,
digits 0 9, punctuation marks and various non-printing
control characters (such as carriage-return and backspace)
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.39
Numeric and Alphabetic Codes 9.7
Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 9.40
Key Points