Title: 2. Revision
12. Revision
- Objective To examine basic concepts of
- 2.1 Numbering Systems
- 2.2 Binary Numbers
- 2.3 Boolean Algebra
- 2.4 Logic Gates
- 2.5 Adders
- 2.6 Timing Diagram
22.1 Number System (base B)
- Number is represented in terms of Positional
Weighting - (N)B dn-1 Bn-1 dn-2 Bn-2... d1 B1 d0 B0
d-1 B-1... d-m B-m - Integral Part.
Fractional Part - B base
- dk digit in position k, -m k n-1
- Bk weight of position k, -m k n-1
- n number of integral digits in N
- m number of fractional digits in N
3The most known systems
- B 10 (Decimal)
- digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
- B 2 (Binary)
- digits (0, 1)
- B 8 (Octal)
- digits (0, 1, 2, 3, 4, 5, 6, 7)
- B 16 (Hexadecimal)
- digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C,
D, E, F)
4Conversions (I)
- How to convert from one number system to the
other (change of base B)? - Algorithm 1
- favorable for conversions to the decimal system
- (N1)A (N2)10
5Conversions (II)
- Algorithm 2 Use of successive divisions and
multiplications - favorable for conversions from the decimal
system - (N1)10 (N2)B
- (34.625)10 (?)2
6Conversions (II) - Example
- (34.625)10 (100010.101)2
- Integral Part Fractional Part
- 34 2 17 r 0 0.625 x 2 1 .25
- 17 2 8 r 1 0.25 x 2 0 .5
- 8 2 4 r 0 0.5 x 2 1
- 4 2 2 r 0
- 2 2 1 r 0
- 1 2 0 r 1
7Binary Hexadecimal
- Binary Hexadecimal
- Form groups of 4 bits starting at binary point.
- Each group of 4 bits represents a hexadecimal
digit. - Hexadecimal Binary
- Convert each hexadecimal digit to its binary
equivalent (4 bits).
8Binary Octal
- Binary Octal
- Form groups of 3 bits starting at binary point.
- Each group of 3 bits represents an octal digit.
- Octal Binary
- Convert each octal digit to its binary equivalent
(3 bits).
92.2 Binary Numbers
- Fixed Point Representation.
- (N)2 has an implicit binary point in a fixed
position. - Notion of complement
- Complement(d) (Base - 1) - d
10Complements of Binary Numbers
- 1s Complement (1CF)
- 2s Complement (2CF)
- 2s Complement of 1001011 ?
11Unsigned Binary Integers (UBI)
- N is represented in terms of positional
weighting 0 N 2n 1 - dn-1dn-2dn-3 ... d2d1d0
- No sign
- N (00011010110)2(7.4) (?)10
- Word of 11 digits
- Fixed point representation, with 4 digits for the
fractional part
12Signed Binary Integers
- 3 ways of representing N with n bits
- Sign-Magnitude Form (SMF)
- 1s Complement Form (1CF)
- 2s Complement Form (2CF)
13Comparison of SMF, 1CF, and 2CF
- Sign Magnitude / 2s Complement / 1s Complement
- (4 bits word length)
- Binary SMF 2CF 1CF
- 0111 7 7 7
- 0110 6 6 6
- 0101 5 5 5
- 0100 4 4 4
- 0011 3 3 3
- 0010 2 2 2
- 0001 1 1 1
- 0000 0 0 0
- 1111 -7 -1 -0
- 1110 -6 -2 -1
- 1101 -5 -3 -2
- 1100 -4 -4 -3
- 1011 -3 -5 -4
- 1010 -2 -6 -5
- 1001 -1 -7 -6
14Binary Addition (by complement)
- The bit sign is treated like any other bit (they
are added!) - The subtraction is performed by addition the
negative numbers are treated like numbers to add. - Addition by 1CF
- Addition by 2CF
15Overflow
- An overflow occurs when the operands have the
same sign and the result has a sign different
from that of the operands. - Ex. 7 3 4 bits word SMF 7 0
111 3 0 011 (-2) 1 010
162.3 Boolean Algebra
- Two elements 0 and 1
- Elementary operators
- AND, OR, NOT
- Representation and algebraic simplification of
Boolean functions and their realization using
logic gates will be studied.
17Boolean Functions Truth Tables
- Any Boolean function defined over n variables,
each taking a Boolean constant value (0 or 1). - The Truth Table represents the function f, with
all 2n combinations of 1s and 0s of its
variables. - Each Boolean function is defined by its truth
table and is represented by inter-connected logic
gates.
18Functions and Logic Gates
19Laws of Boolean Algebra
- Together with
- Postulates (or axioms)
- Theorems
- Manipulations (proof)
- Algebraic
- Tabular
- Simplifications
- Algebraic
20Proofs and Simplifications
- Algebraic Proofs
- Tabular Proofs
- Algebraic Simplifications
21Examples
- Algebraic Proof
- (A B) B A B
- B (A B) (Commutative, OR)
- (B A) (B B) (Distributive, OR)
- (B A) (1) (Complementation, OR)
- (B A) (Identity Element, AND)
- A B (Commutative, OR)
22Examples
- Proof by Truth Table
- (A B) B A B
- A B (A B) B A B
- 0 0 0 0
- 0 1 1 1
- 1 0 1 1
- 1 1 1 1
23Examples
Example f(ABC) AC AB ABC ?
AC AB ABC ABC (Absorption, OR) AC
AB AC (B B) (Distributive, AND) AC
AB AC (1) (Complementation,
OR) AC AB AC (Identity
Element, AND) AB AC AC
(Commutative, OR) AB CA CA
(Commutative, AND (2 times)) AB C (AA)
(Distributive,
AND) AB C (1)
(Complimentation, OR) AB C
(Identity Element, AND)
24Representation Canonical Forms
- Canonical Sum of Products Form (CSOP or Sm)
- Sum of mintermes
- Ex. f (A, B) (AB) (AB) Sm(1, 3 )
- Canonical Product of Sums Form
- (CPOS or PM)
- Product of maxtermes
- Ex. f (A, B) (AB) (AB) PM(1, 2)
25Examples of Canonical Forms
- According to De Morgans law
- Mi' mi and mi' Mi
- Say f(A, B, C) defined by
- A B C f
- 0 0 0 0
- 0 0 1 1
- 0 1 0 0
- 0 1 1 0
- 1 0 0 1
- 1 0 1 1
- 1 1 0 1
- 1 1 1 1
26Examples of Canonical Forms
- f(A, B, C) defined by
- A B C f
- 0 0 0 0
- 0 0 1 1
- 0 1 0 0
- 0 1 1 0
- 1 0 0 1
- 1 0 1 1
- 1 1 0 1
- 1 1 1 1
- ABC ABC ABC ABC ABC
- Sm (1, 4, 5, 6, 7) is the CSOP form of f
27Examples of Canonical Forms
- f(A, B, C) defined by
- A B C f
- 0 0 0 0
- 0 0 1 1
- 0 1 0 0
- 0 1 1 0
- 1 0 0 1
- 1 0 1 1
- 1 1 0 1
- 1 1 1 1
- (ABC) (ABC) (ABC)
- PM (0, 2, 3) is the CPOS form of f.
28Equivalence of Canonical Forms
- f(A, B, C) Sm (0, 4, 5, 7) PM (?)
- PM (1, 2, 3, 6)
- f(A, B, C, D) PM (2, 3, 5, 6, 7) Sm (?)
- Sm (0, 1, 4) ???
- Sm (0, 1, 4, 8, 9, 10, 11, 12, 13, 14, 15) !!!
29Canonical Forms (encore!)
- A function f is not necessarily represented in a
canonical form. - f(A, B, C) ABC AB BC
- How to obtain the canonical forms of such
functions? - Algebraic method
30Algebraic Method
- f(A, B, C) AB C ABC
- AB(CC) C(AA)(BB) ABC
- ABC ABC ABC ABC ABC ABC
ABC - ABC ABC ABC ABC ABC ABC
- S m(3, 2, 6, 4, 0, 7)
31Remarks on Boolean Functions
- Single representation (POS or SOP).
- Logical equivalence.
- How many possible functions for N Boolean
variable? - Functions with 2 Boolean variables
32Functionally Complete Sets
- Together of operators being able to represent all
the functions - AND, NOT, OR, NOR, NAND
- POS form with NOR
- SOP form with NAND
332.4 Logic Gates
- The logic gates implement the switching functions
- A gate with N inputs represents a function with N
Boolean variables - One comes across OR, AND, NOR, and NAND gates
with N inputs
34Synthesis with Logic Gates
- To implement a switching function with logic
gates - f(A, B, C) (A (BC)')'
- ß
35Analysis with Logic Gates
- To find the functionality of the circuit made up
of logic gates - ß
- f(A, B, C) (A (BC)')'
36Synthesis with Single Gates
- More economical than AND, OR, NOT
- SOP form with NAND
- POS form with NOR
- Similar to SOP.
37Return to NOR-NAND
- f(A, B, C, D) AB AC D
- To implement with NAND ( ) only
- ((AB AC D))
- ((AB) . (AC) . (D))
- (AB) (AC) (D)
- (AB) (A C) (D)
38Return to NOR-NAND
- f(A, B, C, D) AB AC D
- To implement with NOR () only
- ((AB)) ((AC)) D
- (AB) (AC) D
- (AB) (AC) D
- (((AB) (AC) D))
- ((AB) (AC) D)
- ((AB) (AC) D) 0
39Return to NOR-NAND
- g(A, B, C, D) (AB).(AC) . D
- Implement with NAND ( ) only
- ((AB)). ((AC)) . D
- (AB) . (AC) . D
- (AB) . (AC) . D
- (((AB) . (AC) . D))
- ((AB) (AC) D)
- ((AB) (AC) D) 1
40Return to NOR-NAND
- g(A, B, C, D) (AB).(AC) . D
- Implement with NOR () only
- (((AB).(AC).D))
- ((AB) (AC) D)
- (AB) (AC) D
- (AB) (A C) D
412.5 Adders
- Classic combinational circuits
- Various common circuits
- Half-Adders
- Elementary adder
- Parallel full-adder
- Elementary subtracter
- Adder-substracter
42Adding words of several bits?
- Parallel full-adder of 4 bits
- EA Elementary Adder
R5
C4
C3
C2
C1
S4
S3
S2
S1
432.6 Logic Timing Diagram
44Complementary Reading
- In Mano and Kime
- Sections 1.2 and 1.3
- Numbers and binary arithmetic
- Sections 2.1, 2.2, 2.3, 2.6 and 2.7
- Boolean algebra, logic gates, canonical forms
- Section 3.8, except  Carry Lookahead AdderÂ
- Adders
- Sections 3.9 and 3.10
- Subtracters