Download presentation
Presentation is loading. Please wait.
Published byBeverly Byrd Modified over 9 years ago
1
CSI-2111 Computer Architecture Ipage 2-1 2. 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
2
CSI-2111 Computer Architecture Ipage 2-2 2.1 Number System (base B) Number is represented in terms of Positional Weighting: ( N ) B = d n-1 B n-1 + d n-2 B n-2 +...+ d 1 B 1 + d 0 B 0 · d -1 B -1 +...+ d -m B -m Integral Part. Fractional Part B = base d k = digit in position k, -m ≤ k ≤ n-1 B k = weight of position k, -m ≤ k ≤ n-1 n = number of integral digits in N m = number of fractional digits in N
3
CSI-2111 Computer Architecture Ipage 2-3 The 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)
4
CSI-2111 Computer Architecture Ipage 2-4 Conversions (I) How to convert from one number system to the other (change of base B )? Algorithm 1: –favorable for conversions to the decimal system (N 1 ) A (N 2 ) 10
5
CSI-2111 Computer Architecture Ipage 2-5 Conversions (II) Algorithm 2: Use of successive divisions and multiplications –favorable for conversions from the decimal system (N 1 ) 10 (N 2 ) B (34.625) 10 (?) 2
6
CSI-2111 Computer Architecture Ipage 2-6 Conversions (II) - Example (34.625) 10 (100010.101) 2 Integral Part: Fractional Part: 34 ÷ 2 = 17r 00.625 x 2 = 1.25 17 ÷ 2 = 8r 10.25 x 2 =0.5 8 ÷ 2 = 4r 00.5 x 2 =1 4 ÷ 2 = 2r 0 2 ÷ 2 = 1r 0 1 ÷ 2 = 0r 1
7
CSI-2111 Computer Architecture Ipage 2-7 Binary 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).
8
CSI-2111 Computer Architecture Ipage 2-8 Binary 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).
9
CSI-2111 Computer Architecture Ipage 2-9 2.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
10
CSI-2111 Computer Architecture Ipage 2-10 Complements of Binary Numbers 1’s Complement : (1CF) 2’s Complement : (2CF) 2’s Complement of 1001011 = ?
11
CSI-2111 Computer Architecture Ipage 2-11 Unsigned Binary Integers (UBI) N is represented in terms of positional weighting: 0 ≤ N ≤ 2 n – 1 d n-1 d n-2 d n-3... d 2 d 1 d 0 No sign N = (00011010110) 2(7.4) = (?) 10 –Word of 11 digits –Fixed point representation, with 4 digits for the fractional part
12
CSI-2111 Computer Architecture Ipage 2-12 Signed Binary Integers 3 ways of representing ± N with n bits: –Sign-Magnitude Form (SMF) –1’s Complement Form(1CF) –2’s Complement Form(2CF)
13
CSI-2111 Computer Architecture Ipage 2-13 Comparison of SMF, 1CF, and 2CF Sign Magnitude / 2’s Complement / 1’s Complement (4 bits word length) BinarySMF2CF1CF 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+00+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 1000-0-8-7
14
CSI-2111 Computer Architecture Ipage 2-14 Binary 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
15
CSI-2111 Computer Architecture Ipage 2-15 Overflow 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 +70 111 +30 011 (-2)1 010
16
CSI-2111 Computer Architecture Ipage 2-16 2.3Boolean 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.
17
CSI-2111 Computer Architecture Ipage 2-17 Boolean 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 2 n combinations of 1’s and 0’s of its variables. Each Boolean function is defined by its truth table and is represented by inter- connected logic gates.
18
CSI-2111 Computer Architecture Ipage 2-18 Functions and Logic Gates
19
CSI-2111 Computer Architecture Ipage 2-19 Laws of Boolean Algebra Together with –Postulates (or axioms) –Theorems Manipulations (proof) –Algebraic –Tabular Simplifications –Algebraic
20
CSI-2111 Computer Architecture Ipage 2-20 Proofs and Simplifications Algebraic Proofs Tabular Proofs Algebraic Simplifications
21
CSI-2111 Computer Architecture Ipage 2-21 Examples * 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 )
22
CSI-2111 Computer Architecture Ipage 2-22 Examples * Proof by Truth Table: (A B’) + B = A + B A B (A B’) + B A + B 0 0 0 1 1 1 1 0 1 1 1 1
23
CSI-2111 Computer Architecture Ipage 2-23 Examples * Algebraic Simplification Example: f(ABC) = AC’ + A’B + A’B’C’ = ? = AC’ + A’B + A’BC’ + A’B’C’(Absorption, OR) = AC’ + A’B + A’C’ (B + B’)(Distributive, AND) = AC’ + A’B + A’C’ (1) (Complementation, OR) = AC’ + A’B + A’C’ (Identity Element, AND) = A’B + AC’ + A’C’ (Commutative, OR) = A’B + C’A + C’A’ (Commutative, AND (2 times)) = A’B + C’ (A+A’) (Distributive, AND) = A’B + C’ (1) (Complimentation, OR) = A’B + C’ (Identity Element, AND)
24
CSI-2111 Computer Architecture Ipage 2-24 Representation: Canonical Forms Canonical Sum of Products Form (CSOP or m) –Sum of mintermes –Ex.: f (A, B) = (A’B) + (AB) = m(1, 3) Canonical Product of Sums Form (CPOS or M) –Product of maxtermes –Ex.: f (A, B) = (A+B’) (A’+B) = M(1, 2)
25
CSI-2111 Computer Architecture Ipage 2-25 Examples of Canonical Forms According to De Morgan’s law: M i ' = m i and m i ' = M i Say f(A, B, C) defined by: ABCf 0000 0011 0100 0110 1001 1011 1101 1111
26
CSI-2111 Computer Architecture Ipage 2-26 Examples of Canonical Forms * f(A, B, C) defined by: A BCf 0 000 00110011 0 100 0 110 10011001 10111011 11011101 11111111 = A’B’C + AB’C’ + AB’C + ABC’ + ABC = m (1, 4, 5, 6, 7) is the CSOP form of f
27
CSI-2111 Computer Architecture Ipage 2-27 Examples of Canonical Forms * f(A, B, C) defined by: ABCf ABCf 0000 0000 0011 0011 0100 0100 0110 0110 1001 1001 1011 1011 1101 1101 1111 1111 = (A+B+C) (A+B’+C) (A+B’+C’) = M (0, 2, 3) is the CPOS form of f.
28
CSI-2111 Computer Architecture Ipage 2-28 Equivalence of Canonical Forms* f(A, B, C) = m (0, 4, 5, 7) = M (?) M (1, 2, 3, 6) f(A, B, C, D) = M (2, 3, 5, 6, 7) = m (?) m (0, 1, 4) ??? m (0, 1, 4, 8, 9, 10, 11, 12, 13, 14, 15) !!!
29
CSI-2111 Computer Architecture Ipage 2-29 Canonical Forms (encore!) A function f is not necessarily represented in a canonical form. f(A, B, C) = A’B’C + AB’+ BC’ How to obtain the canonical forms of such functions? –Algebraic method
30
CSI-2111 Computer Architecture Ipage 2-30 Algebraic Method* f(A, B, C) = A’B + C’ + ABC =A’B(C+C’) + C’(A+A’)(B+B’) +ABC =A’BC + A’BC’ + ABC’ + AB’C’ + A’BC’ + A’B’C’ + ABC =A’BC + A’BC’ + ABC’ + AB’C’ + A’B’C’ + ABC = m(3, 2, 6, 4, 0, 7)
31
CSI-2111 Computer Architecture Ipage 2-31 Remarks on Boolean Functions Single representation ( POS or SOP ). Logical equivalence. How many possible functions for N Boolean variable? Functions with 2 Boolean variables
32
CSI-2111 Computer Architecture Ipage 2-32 Functionally 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}
33
CSI-2111 Computer Architecture Ipage 2-33 2.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
34
CSI-2111 Computer Architecture Ipage 2-34 Synthesis with Logic Gates To implement a switching function with logic gates f (A, B, C) = (A + (BC)')' B C A f
35
CSI-2111 Computer Architecture Ipage 2-35 Analysis with Logic Gates To find the functionality of the circuit made up of logic gates f (A, B, C) = (A + (BC)')' B C A f
36
CSI-2111 Computer Architecture Ipage 2-36 Synthesis with Single Gates More economical than {AND, OR, NOT} SOP form with {NAND} POS form with {NOR} –Similar to SOP. A B A+B A 1 B 1
37
CSI-2111 Computer Architecture Ipage 2-37 Return to NOR-NAND * f (A, B, C, D) = AB’ +A’C + D To implement with NAND ( ) only: = ((AB’ +A’C + D)’)’ = ((AB’)’. (A’C)’. (D)’)’ = (AB’)’ (A’C)’ (D)’ = (A B’) (A’ C) (D)’
38
CSI-2111 Computer Architecture Ipage 2-38 Return to NOR-NAND * f (A, B, C, D) = AB’ +A’C + D To implement with NOR ( only: = ((AB’)’)’ + ((A’C)’)’ + D = (A’+B)’ + (A+C’)’ + D = (A’ B) +(A C’) + D = (((A’ B) +(A C’) + D)’)’ = ((A’ B) (A C’) D)’ = ((A’ B) (A C’) D) 0
39
CSI-2111 Computer Architecture Ipage 2-39 Return to NOR-NAND * g (A, B, C, D) = (A+B’).(A’+C). D Implement with NAND ( ) only: = ((A+B’)’)’. ((A’+C)’)’. D = (A’B)’. (AC’)’. D = (A’ B). (A C’). D = (((A’ B). (A C’). D)’)’ = ((A’ B) (A C’) D)’ = ((A’ B) (A C’) D)
40
CSI-2111 Computer Architecture Ipage 2-40 Return to NOR-NAND * g (A, B, C, D) = (A+B’).(A’+C). D Implement with NOR ( only: = (((A+B’).(A’+C).D)’)’ = ((A+B’)’ + (A’+C)’ + D’)’ = (A+B’)’ (A’+C)’ D’ = (A B’) (A’ C) D’
41
CSI-2111 Computer Architecture Ipage 2-41 2.5 Adders Classic combinational circuits Various common circuits –Half-Adders –Elementary adder –Parallel full-adder –Elementary subtracter –Adder-substracter
42
CSI-2111 Computer Architecture Ipage 2-42 Adding words of several bits? Parallel full-adder of 4 bits EA = Elementary Adder EA B4B4 A4A4 C4C4 S4S4 B3B3 A3A3 C3C3 S3S3 B2B2 A2A2 C2C2 S2S2 B1B1 A1A1 C1C1 S1S1 R5R5
43
CSI-2111 Computer Architecture Ipage 2-43 2.6 Logic Timing Diagram
44
CSI-2111 Computer Architecture Ipage 2-44 Complementary 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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.