You are on page 1of 11

Homework 9 due 6/16 5-16) Design a sequential circuit with two D FFs, A and B, and one input x.

. When x = 0, the state of the circuit remains the same. When x = 1, the circuit goes through the state transitions from 00 to 01 to 11 to 10 back to 00 and repeats. State Input Next state A B x A B 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 0 x\AB 00 01 11 0 0 0 1 1 0 1 0 DA = xA + AB + xAB x\AB 00 01 0 0 1 1 1 0 DB = xB + xB 11 1 0 10 1 1

10 0 1

5-17) Design a one input, one output serial 2s complementer. The circuit accepts a string of bits from the input and generates the 2s complement at the output. The circuit can be reset asynchronously to start and end the operation.

Half a adder b c

2s complement x

begin S Q D

This circuit implements the serial 2s-complement operation. Before the first bit of x is shifted in, the FF is set to 1, representing the 1 that gets added to the number. X is shifted in, LSB first, with each bit complemented as it is added. Since this circuit only has 1 input, it is not necessary to use a full adder a half adder will do, since the only inputs are x and the carry result from lower order bits.

5-18) Design a sequential circuit with two JK FFs A and B and two inputs E and x. If E=0, the circuit remains in the same state, regardless of the value of x. When E = 1 and x = 1, the circuit goes through the state transitions from 00 to 01 to to 10 to 11 back to 00, and repeats. When E = 1 and x = 0, the circuit goes through the state transitions from 00 to 11 to 10 to 01 and back to 00, and repeats. State A 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 Q(t) 0 0 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 J 0 1 X X K X X 1 0 B Input E X 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 Q(t+1) 0 1 0 1 11 0 1 X X 11 X X 1 0 10 1 0 X X 10 X X 0 1 Next A 0 0 1 0 0 0 0 1 1 1 0 1 1 1 1 0 B 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 JA 0 0 1 0 0 0 0 1 X X X X X X X X Controls KA JB X 0 X 0 X 1 X 1 X X X X X X X X 0 0 0 0 1 1 0 1 0 X 0 X 0 X 1 X

KB X X X X 0 0 1 1 X X X X 0 0 1 1

AB\Ex 00 01 00 0 0 01 0 0 11 X X 10 X X J A = BEx + BEx AB\Ex 00 01 00 X X 01 X X 11 0 0 10 0 0 K A = BEx + BEx

AB\Ex 00 01 11 10 JB = E AB\Ex 00 01 11 10 KB = E

00 0 X X 0 00 X 0 0 X

01 0 X X 0 01 X 0 0 X

11 1 X X 1 11 X 1 1 X

10 1 X X 1 10 X 1 1 X

5-19) A sequential circuit has three FFs A, B, C; one input x, and one output y. The state transition diagram is shown below. The circuit is to be designed by treating the unused states as dont-care conditions. Analyze the circuit obtained to determine the effect of the unused states. a) use D FFs in the design b) use JK FFs in the design

0/0
001

1/1
100

0/0 1/0
011

0/0

0/0
010

1/1

1/1

0/0

1/1
000

A 0 0 1 1 0 0 0 0 0 0

State B 0 0 0 0 1 1 1 1 0 0

C 1 1 0 0 0 0 1 1 0 0

Input x 0 1 0 1 0 1 0 1 0 1

A 0 1 0 0 0 0 0 0 0 1

Next state B C 0 1 0 0 1 0 1 1 1 0 0 0 0 1 1 0 1 1 0 0

Output y 0 1 0 0 0 1 0 1 0 1

a) With D FF: xA\BC 00 01 00 0 0 01 0 X0 11 0 X0 10 1 1 DA =xAB xA\BC 00 00 1 01 1 11 1 10 0 DB = A + xA\BC 00 00 1 01 0 11 1 10 0 DC = xA xA\BC 00 00 0 01 0 11 0 10 1 y = xA

11 0 X0 X0 0

10 0 X0 X0 0

01 11 10 0 0 1 X1 X1 X1 X1 X1 X1 0 1 0 xC + xBC 01 1 X1 X1 0 + xC 01 0 X0 X0 1 11 10 1 0 X1 X0 X1 X1 0 0 + xAB 11 0 X0 X0 1 10 0 X0 X0 1

A 1 1 1 1 1 1

State B 0 0 1 1 1 1

C 1 1 0 0 1 1

X1 indicates a dont care that has been set to 1 X0 indicates a dont care that has been set to 0 Resulting extra states: Input Next state Output x A B C y 0 0 1 1 0 1 0 1 1 0 0 0 1 0 0 1 0 1 1 0 0 0 1 1 0 1 0 1 1 0

0/0
001

0/0 0/0 1/0


011

101

1/1
100

1/0 0/0 0/0


010

0/0
111

1/1

1/0 1/0 0/0 0/0


110

1/1

1/1
000

b) with JK FF State B 0 0 0 0 1 1 1 1 0 0 Input x 0 1 0 1 0 1 0 1 0 1 Q(t) 0 0 1 1 J 0 1 X X 01 0 X0 X1 1 01 X1 X1 X1 X1 Next state B C 0 1 0 0 1 0 1 1 1 0 0 0 0 1 1 0 1 1 0 0 Q(t+1) 0 1 0 1 11 0 X0 X0 0 11 X1 X1 X1 X1 10 0 X0 X0 0 10 X1 X1 X1 X1 Output y 0 1 0 0 0 1 0 1 0 1 Controls JB KB 0 X 0 X 1 X 1 X X 0 X 1 X 1 X 0 1 X 0 X

A 0 0 1 1 0 0 0 0 0 0

C 1 1 0 0 0 0 1 1 0 0

A 0 1 0 0 0 0 0 0 0 1

JA 0 1 X X 0 0 0 0 0 1

KA X X 1 1 X X X X X X

JC X X 0 1 0 0 X X 1 0

KC 0 1 X X X X 0 1 X X

K X X 1 0

xA\BC 00 00 0 01 X0 11 X1 10 1 JA = xB xA\BC 00 00 X1 01 1 11 1 10 X1 KA = 1

xA\BC 00 01 00 1 0 01 1 X1 11 1 X1 10 0 0 JB = A + xC xA\BC 00 01 00 X0 X1 01 X0 X1 11 X1 X0 10 X1 X0 KB = xC + xC xA\BC 00 01 11 10 JC

11 X0 X1 X1 X0 11 1 X1 X0 0

10 X1 X1 X1 X0 10 0 X0 X1 1

00 01 11 1 X1 X0 0 X0 X0 1 X1 X1 0 X0 X0 = xAB + xA

10 0 X0 X1 0

xA\BC 00 00 X0 01 X0 11 X1 10 X1 KC = x

01 0 X0 X1 1

11 0 X0 X1 1

10 X0 X0 X1 X1

A 1 1 1 1 1 1

State B 0 0 1 1 1 1

C 1 1 0 0 1 1

Resulting extra states: Input Next state x A B C 0 0 1 1 1 0 1 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 1 0

Output y 0 0 0 0 0 0

0/0 1/0
001 110

0/0 0/0
111 100

1/1 1/0 0/0 0/0


010

0/0
011

1/0 1/1

1/1

0/0 0/0
101

1/0

1/1
000

6-4) The contents of a 4-bit register is initially 1101. The register is shifted six times to the right with the serial input being 101101. What is the content of the register after each shift? Register contents 1101 1110 0111 1011 1101 0110 1011 Remaining input 101101 01101 1101 101 01 1 -

Design a 3-bit Universal Shift Register using AND, OR, NOT, NAND or NOR gates and D Flip-flops that implements the following functions : S1 S2 Function 0 0 Shift left 0 1 Shift right 1 0 Parallel load from top 1 1 Parallel load from botton The shift register has top and bottom D inputs and Q outputs, as well as right and left shift-in inputs and shift-out outputs This is the Select logic at the input of each D FF:

L R B S1 S2

This is the overall register design:

T0

T1

T2

Lout Lin S1,2


Clock
Select Logic

Rin
D Q
Select Logic

D Q

Select Logic

D Q

Rout

B0

Q0 B1

Q1 B2

Q2

You might also like