CSE 140 Homework 5 Solutions - University of California ...

Post on 01-Dec-2021

7 views 0 download

Transcript of CSE 140 Homework 5 Solutions - University of California ...

CSE 140 Homework 5 Solutions

I.

1. The state table is as follows:

PS X=0 X=1

00 00, 1 10, 1

01 10, 1 01, 1

10 01, 0 10, 0

11 11, 1 01, 1 Q1(t)Q0(t) Q1(t+1)Q0(t+1), Y

Let the state assignment be as follows:

S0=00, S1=01, S2=10, S3=11

The state table will then look like:

PS X=0 X=1

S0 S0, 1 S2, 1

S1 S2, 1 S1, 1

S2 S1, 0 S2, 0

S3 S3, 1 S1, 1

2. Design the system with T flip flops

The excitation table is as follows:

Q1(t) Q0(t) X Q1(t+1) Q0(t+1) T1 T0

0 0 0 0 0 0 0

0 0 1 1 0 1 0

0 1 0 1 0 1 1

0 1 1 0 1 0 0

1 0 0 0 1 1 1

1 0 1 1 0 0 0

1 1 0 1 1 0 0

1 1 1 0 1 1 0

The excitation table for a T flip flop looks like:

NS PS 0 1

0 0 1

1 1 0

Q1Q0 X

00 01 11 10

0 0 1 0 1

1 0 0 0 0

T0 = X’Q1’Q0 + X’Q1Q0’

Q1Q0 X

00 01 11 10

0 0 1 0 1

1 1 0 1 0

T1 = XQ1’Q0’ + X’Q1’Q0 + XQ1Q0 + X’Q1Q0’

The schematic diagram for the same is shown below.

3. Design the system using JK flip flops

The excitation table for a JK flip flop looks like:

JK

NS PS 0 1

0 0- 1-

1 -1 -0

Q1(t) Q0(t) X Q1(t+1) Q0(t+1) J0 K0 J1 K1

0 0 0 0 0 0 - 0 -

0 0 1 1 0 0 - 1 -

0 1 0 1 0 - 1 1 -

0 1 1 0 1 - 0 0 -

1 0 0 0 1 1 - - 1

1 0 1 1 0 0 - - 0

1 1 0 1 1 - 0 - 0

1 1 1 0 1 - 0 - 1

Q1Q0 X

00 01 11 10

0 0 - - 1

1 0 - - 0

J0 = X’Q1

Q1Q0 X 00 01 11 10

0 - 1 0 -

1 - 0 0 -

K0=X’Q1’

Q1Q0 X 00 01 11 10

0 0 1 - -

1 1 0 - -

J1=XQ0’+X’Q0

Q1Q0 X 00 01 11 10

0 - - 0 1

1 - - 1 0

J1=XQ0+X’Q0’

The following figure shows the schematic diagram for the same

II.

1. Implementation using a 4:16 decoder:

2. Implementation using 3:8 decoders

3. Implementation using 2:4 decoders

III.

The truth table for the given function looks like:

a b c f

0 0 0 1

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 1

1 1 0 -

1 1 1 1 1. Implementation using a 8:1 mux is given below:

2. Implementation of a 4:1 mux is given below:

ab c=0 c=1

00 1 0 I0=c’

01 0 1 I1=c

10 0 1 I2=c

11 - 1 I1=1

3. Implementation using a 2:1 mux is given below:

Bc

a 00 01 10 11

0 1 0 0 1 I0

1 0 1 - 1 I1

c b 0 1

0 1 0

1 0 1

I0 = b’c’ + bc

c b

0 1

0 0 1

1 - 1

I1 = c

Implementation of I0 = b’c’+bc

b c=0 c=1

0 1 0 I0=c’

1 0 1 I1=c

IV.

The truth table for the given function looks like the following:

a b c f

0 0 0 1

0 0 1 -

0 1 0 1

0 1 1 0

1 0 0 1

1 0 1 0

1 1 0 1

1 1 1 1

1. Implementation using 2:4 decoder is given below.

Alternative Solution.

f(a,b,c)=ab+c’ (using Kmap)

The implementation will therefore be

2. Implementation using 4:1 Mux

ab c=0 c=1

00 1 - I0=1

01 1 0 I1=c’

10 1 0 I2=c’

11 1 1 I3=1

3. Implementation using 2:1 Mux

Bc

a 00 01 10 11

0 1 - 1 0 I0

1 1 0 1 1 I1

c b

0 1

0 1 -

1 1 0

I0 = c’

c b

0 1

0 1 0

1 1 1

I1 = b+c’

Implementation of I1 = b+c’

B c=0 c=1

0 1 0 I0=c’

1 1 1 I1=1