Sunteți pe pagina 1din 11

One-hot method

Computer Architecture

State and Binary Code


If there are n states.
Use n D flip-flop for coding state.

Ex. There are 4 states.


state

code

S1

0001

S2

0010

S3

0100

S4

1000

Logic circuit and State


S1
00/111

0d/001

10/010

S4
10/100

S2

11/100
01/010

S3

Logic circuit and State


S1
00/111

0d/001

10/010

S4
10/100

S2

11/100
01/010

S3

state

code

S1

0001

S2

0010

S3

0100

S4

1000

Logic circuit and State


S1

00/111

10/100

S2

11/100

01/010
S3

Code=D4 D3 D2 D1

S1

0001

S2

0010

S3

0100

S4

1000

0d/001
10/010

S4

state

D1+=D3(I=10)+D4(I=00)
D2+=D1(I=0d)+D3(I=11)
D3+=D2(I=01)
D4+=D2(I=10)

Logic circuit and State


S1
00/111

0d/001
10/010

S4

10/100

Code=D4 D3 D2 D1

S1

0001

S2

0010

S3

0100

S4

1000

S2

11/100
01/010

S3

state

D1+=D3(I=10)+D4(I=00)
D2+=D1(I=0d)+D3(I=11)
D3+=D2(I=01)
D4+=D2(I=10)
Output: Z = z3z2z1
z1 = D1+D4
z2 = D2+D4
z3 = D3+D4

Logic circuit and State


D1+=D3(I=10)+D4(I=00)
D2+=D1(I=0d)+D3(I=11)
D3+=D2(I=01)
D4+=D2(I=10)

I1
I2
D3

D1

I1
I2
D4

D
flip-flop

clock

D1

Your turn
Finish the remainder control circuit.
D1+=D3(I=10)+D4(I=00)
D2+=D1(I=0d)+D3(I=11)
D3+=D2(I=01)
D4+=D2(I=10)

Logic circuit and State


Output: Z = z3z2z1
z1 = D1+D4
z2 = D2+D4
z3 = D3+D4

D4 D3 D2 D1
z1

z2

z3

Your Turn
Using one-hot method design a control circuit
for the following state machine.
S1
10/100
00/100

S4
11/100

0d/001
11/011

10/110
01/110

S2

11/110
01/011

S3

Your Turn
Using one-hot method design a control circuit
for the following state machine.
11/00100
00/00100
S1

00/00000

d1/00000
10/00000
S4

01/00100
1d/01010

S2

11/10001
10/10001
01/10001
11/00000
01/01010
S3

00/10001

00/01010

S-ar putea să vă placă și