Digital System Fundamentals and Arithmetic Structures
This content delves into digital system fundamentals and various arithmetic structures, including addition, subtraction, specialized structures, binary operations, half/full adders, ripple carry adders, and more. It discusses hardware design, binary subtraction, adder/subtractor implementation, and additional logic for operation control.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
ECE 352 Digital System Fundamentals Arithmetic Structures Arithmetic Structures 1 1 1
Topics Arithmetic Structures Addition and Subtraction Contraction and Specialized Structures Other Arithmetic Operations Arithmetic Structures 2 2 2
Review: Binary Addition Same operation at every bit position: Add two bits plus carry-in if present If result larger than representable by one bit, carry-out from that position How should we create hardware for this? Design hardware for one bit position Replicate! Arithmetic Structures 3 3 3
Review: Half/Full Adders Half Adder Adds two single-bit inputs A B Arithmetic Structures C S Full Adder Adds three single-bit inputs Built from two half-adders plus an OR gate A B COUT CIN Need a full adder to propagate the carry! S 4 4 4
Ripple Carry Adder Combinational circuit to add two binary vectors In an n-bit number the LSb has subscript 0 and the MSb has subscript n-1 Series of Full Adders A carry can occur at any bit position and ripple through towards the most significant bit. Arithmetic Structures A3 B3 A2 B2 A1 B1 A0 B0 C3 C2 C1 C4 C0 S3 S2 S1 S0 the carry-out of each full adder is the carry-in to the next 5 5 5
Binary Subtractor Modify ripple-carry adder: A + ( B) Bitwise complement B before the addition Add the 1 to B using the carry-in Arithmetic Structures flip all the bits A3 B3 A2 B2 A1 B1 A0 B0 C3 C2 C1 C4 1 and add 1 S3 S2 S1 S0 6 6 6
Adder/Subtractor Use the same structure to both add and subtract Conditionally negate the second operand If we want to add, don t negate If we want to subtract, negate: Flip all the bits and add 1 Arithmetic Structures Augment the structure with additional logic and a special control signal Control input to the adder/subtractor chooses the mode of operation Depending on its value, the structure adds or subtracts 7 7 7
Binary Adder-Subtractor Subtract if SUB is 1, add if SUB is 0 XOR it with all bits of second operand Flip all the bits IFwe want to subtract (but do not if we add) Use it as the carry input Add 1 IFwe want to subtract (but not if we add) Arithmetic Structures B3 B2 B1 B0 SUB A3 A2 A1 A0 C3 C2 C1 C4 S3 S2 S1 S0 8 8 8
Overflow Detection We know we have overflow if the result cannot fit in the required number of bits But how can we automatically detect this? Arithmetic Structures Unsigned overflow if C = 1 Cout of MSb is 1 Signed overflow if V = 1 Cin to MSb does not match Cout from MSb Bn-1 Bn-1 Bn-1 Bn-2 Bn-2 Bn-2 SUB SUB SUB An-1 An-1 An-1 An-2 An-2 An-2 Cn Cn Cn-1 Cn-1 Cn-1 Cn-2 Cn-2 Cn-2 C C Cn V Sn-1 Sn-1 Sn-1 Sn-2 Sn-2 Sn-2 9 9 9
Topics Arithmetic Structures Addition and Subtraction Contraction and Specialized Structures Other Arithmetic Operations Arithmetic Structures 10 10 10
Contraction If an input to a circuit will always be a constant value, we can simplify the circuit Apply Boolean algebra rules to reduce and/or remove gates Arithmetic Structures X + 1 = 1 X + 0 = X X 1 = X X 0 = 0 X + X = 1 X X = 0 X + X = X X X = X X = X Contraction makes the circuit smaller, faster, and less complex (more efficient for a specific task) 11 11 11
Example: Incrementer Note: if an amount is not specified, should assume increment means add 1 Simplified adder structure Set the B input to 0012, then simplify Arithmetic Structures 0 0 1 A2 B2 A1 B1 A0 B0 C0 0 C3 S2 S1 S0 12 12 12
Example: Incrementer Note: if an amount is not specified, should assume increment means add 1 Simplified adder structure Set the B input to 0012, then simplify Arithmetic Structures inverter 0 0 1 A2 B2 A1 B1 A0 B0 A0 C0 0 C3 = A0 0 S2 S1 S0 13 13 13
Example: Incrementer Note: if an amount is not specified, should assume increment means add 1 Simplified adder structure Set the B input to 0012, then simplify Arithmetic Structures 0 0 A2 A1 A0 0 C3 S2 S1 S0 14 14 14
Example: Incrementer Note: if an amount is not specified, should assume increment means add 1 Simplified adder structure Set the B input to 0012, then simplify Arithmetic Structures 0 A2 A1 A0 0 C3 S2 S1 S0 15 15 15
Example: Incrementer Note: if an amount is not specified, should assume increment means add 1 Simplified adder structure Set the B input to 0012, then simplify Arithmetic Structures We can also remove AND gate if the carry-out is not needed A2 A1 A0 C3 S2 S1 S0 16 16 16
Example: Decrement-by-two Decrement by two means add 2 Set the B input to 1102, then simplify We could use adder/subtractor in subtract mode and use B = 0102, but that requires more simplification! Arithmetic Structures 1 1 0 A2 B2 A1 B1 A0 B0 C0 0 C3 S2 S1 S0 17 17 17
Example: Decrement-by-two Decrement by two means add 2 Set the B input to 1102, then simplify We could use adder/subtractor in subtract mode and use B = 0102, but that requires more simplification! Arithmetic Structures 1 1 A2 A2 A2 A1 A1 A1 A0 A0 A0 0 C3 C3 C3 S2 S2 S2 S1 S1 S1 S0 S0 S0 18 18 18
Example: Decrement-by-two Decrement by two means add 2 Set the B input to 1102, then simplify We could use adder/subtractor in subtract mode and use B = 0102, but that requires more simplification! Arithmetic Structures C3 = A2 + A2A1 = A2 + A1 A2 A2 A1 A1 A0 A0 C3 C3 S2 S2 S1 S1 S0 S0 19 19 19
Topics Arithmetic Structures Addition and Subtraction Contraction and Specialized Structures Other Arithmetic Operations Arithmetic Structures 20 20 20
Zero-Fill and Sign Extension Sometimes need to represent an operand using additional bits For example, add 4-bit operand to an 8-bit operand If unsigned, need to zero-fill Append 0s to most significant end of vector Example: 0101 becomes 00000101 Example: 1011 becomes 00001011 If signed, need to sign extend Replicate MSb for additional upper bits Example: 0101 becomes 00000101 Example: 1011 becomes 11111011 Arithmetic Structures 21 21 21
Multiplication/Division General multipliers/dividers more complicated than we deal with in this class Powers of 2 make multiply/divide easy: just shift left/right by log2of the multiplier/divisor Example: 010102 410 = 01010002 Example: 011102 210 = 001112 Can use a sequence of additions to multiply by a constant value Example: 011102 610 = (011102 410) + (011102 210) Arithmetic Structures = 01110002 + 0111002 = 10101002 22 22 22
ECE 352 Digital System Fundamentals Arithmetic Structures Arithmetic Structures 23 23 23