Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digital Electronics Tutorial: Number System & Arithmetic Circuits Solutions.

Similar presentations


Presentation on theme: "Digital Electronics Tutorial: Number System & Arithmetic Circuits Solutions."— Presentation transcript:

1 Digital Electronics Tutorial: Number System & Arithmetic Circuits Solutions

2 Number System  Conversion to Base 10  FFA 16  1101100 2  1000 2  1000 16  Binary Addition in 2’complement  100 110 + 000 111  100 111 + 000 101  100 111 + 100 100  011 111 + 010 111  Binary Subtraction in 2’complement  100 110 - 000 111  100 111 - 000 101  100 111 - 100 100  011 111 - 010 111

3 Number System Solutions (1/3)  Conversion to Base 10  FFA 16 = F × 16 2 + F × 16 1 + A × 16 0 = 15 × 16 2 + 15 × 16 1 + 10 × 16 0 = 4090  1101100 2 = 1 × 2 6 + 1 × 2 5 + 0 × 2 4 + 1 × 2 3 + 1 × 2 2 + 0 × 2 1 + 0 × 2 0 = 108  1000 2 = 1 × 2 3 + 0 × 2 2 + 0 × 2 1 + 0 × 2 0 = 8  1000 16 = 1 × 16 3 + 0 × 16 2 + 0 × 16 1 + 0 × 16 0 = 4096

4 Number System Solutions (2/3)  Binary Addition in 2’complement 100 110 + 000 111 __________ 101 101 100 111 + 000 101 __________ 101 100 100 111 + 100 100 __________ Overflow1 001 011 011 111 + 010 111 __________ Overflow 110 110

5 Number System Solution (3/3)  Binary Subtraction in 2’complement  100 110 - 000 111 = 100 110 + 111 000 + 1  100 111 - 000 101 = 100 111 + 111 010 + 1  100 111 - 100 100 = 100 111 + 011 011 + 1  011 111 - 010 111 = 011 111 + 101 000 + 1 100 110 + 111 000 1 Overflow1 011 111 100 111 + 111 010 1 Overflow1 100 010 100 111 + 011 011 1 1 000 011 011 111 + 101 000 1 1 001 000

6 Arithmetic Circuits Implement a combinational logic circuit that converts a 4-bit sign and magnitude numbers into corresponding 4-bit two’s complement numbers. Draw an input/output conversion truth table, intermediate K-maps, and your minimised two-level logic description.

7 Arithmetic Circuits Solution (1/4) ABCDEFGH00000001001000110100010101100111 10000000 10011111 10101110 101111011100 11011011 11101010 11111001 CD AB 00 01 11 10 00 0 0 1 0 01 0 0 1 1 11 0 0 1 1 10 0 0 1 1 E = AB + AC + AD

8 Arithmetic Circuits Solution (2/4) ABCDEFGH00000001001000110100010101100111 10000000 10011111 10101110 101111011100 11011011 11101010 11111001 CD AB 00 01 11 10 00 0 1 1 0 01 0 1 0 1 11 0 1 0 1 10 0 1 0 1 F = A ’ B + B C’ D’ + A B’ D + A B’ C

9 Arithmetic Circuits Solution (3/4) ABCDEFGH00000001001000110100010101100111 10000000 10011111 10101110 101111011100 11011011 11101010 11111001 CD AB 00 01 11 10 00 0 0 0 0 01 0 0 1 1 11 1 1 0 0 10 1 1 1 1 G = C D ’ + A’ C + A C’ D

10 Arithmetic Circuits Solution (4/4) ABCDEFGH00000001001000110100010101100111 10000000 10011111 10101110 101111011100 11011011 11101010 11111001 CD AB 00 01 11 10 00 0 0 0 0 01 1 1 1 1 11 1 1 1 1 10 0 0 0 0 H = D

11 Bit-Serial Adder The traditional binary adder operates on all of its input bits at the same time, calculating the sum output bits in parallel. Consider an alternative way to implement a binary adder using a so-called bit serial approach. The two numbers to be added are presented to a Finite State Machine one bit at a time, with the lowest order bits presented first. The Finite State Machine produces at its output the lowest order bit of the sum, then the next higher order sum bit, and so on, until all of the input bits have been processed and all of the output sum bits generated. (a) Design a simple datapath for the bit-serial adder down to the gate level, and identify the interface between your control finite state machine and the datapath. Consider how to deal with carry-in and carry-out in your design. (b) Show your state diagram for a 4-bit bit-serial adder, where the outputs of the state machine are the control signals of the datapath you designed in (a). (c) Demonstrate how your subsystem works by showing step-by-step how it executes the summation of 0110 and 1100. The carry-in to the low order bit is initially zero.

12 Bit-Serial Adder Solution (1/3) (a) Design a simple datapath for the bit- serial adder down to the gate level, and identify the interface between your control finite state machine and the datapath. Consider how to deal with carry-in and carry-out in your design. Signals: SHIFT, CinSELECT, SELECT, CE

13 Bit-Serial Adder Solution (2/3) (b) Show your state diagram for a 4-bit bit-serial adder, where the outputs of the state machine are the control signals of the datapath you designed in (a).

14 Bit-Serial Adder Solution (3/3) (c) Demonstrate how your subsystem works by showing step-by-step how it executes the summation of 0110 and 1100. The carry-in to the low order bit is initially zero. A[3:0] = 0110B[3:0] = 1100Cin = 00110 + 1100 = 1 0010 A[3:0] = 0110B[3:0] = 1100 Step 1:SELECT = 00CinSELECT = 0SUM = 0000Cout = 0 Step 2:SELECT = 01CinSELECT = 1SUM = 1000Cout = 0 Step 3:SELECT = 10CinSELECT = 1SUM = 0100Cout = 1 Step 4: SELECT = 11CinSELECT = 1SUM = 0010Cout = 1 Cout Sum


Download ppt "Digital Electronics Tutorial: Number System & Arithmetic Circuits Solutions."

Similar presentations


Ads by Google