- #1
electroguy02
- 5
- 0
Homework Statement
Can someone check my work?
[...] Receiving DATA in binary. The string length of each word is unknown. You are told that each word, demarcated by SYNC signals, is a two's complement number.
Your task is to develop a synchronous sequential machine which examines the received data as input and produces as output the negative of the input number by performing the two's complement operation on the incoming data. Your circuit should have two inputs: DATA and SYNC.
Homework Equations
If the DATA string 10011100011010 is given (where the first digit is the first input), along with the SYNC string 10000010000000, the output should be 11100000010101.
The LSB is the DATA bit that shows up when SYNC = 1.
Short-cut rule for performing a two's complement operation on a string of data:
"Starting with the LSB and moving toward the MSB, transcribe all zeros until you reach the first '1', transcribe that '1' then complement every bit after (more significant than) that."
The Attempt at a Solution
I have already made a working Mealy machine with this functional specification. I'm just having trouble on the Moore machine. SYNC is equal to 1 for only one positive-edge clock pulse.
For the Moore machine, there are three states:
[State 00]: Only zeros are received when SYNC = 1. Output is 0.
[State 01]: First one received when SYNC = 1. Also, zeros after first one is received (and SYNC = 0). Output is 1.
[State 10]: 1 received after first one is received. Output is 0.
I'm trying to use D flip-flops for this, so I made the following state transition table:
Inputs Present State Next State Output D flip-flops
SYNC DATA | A B | A+ B+ | z | D_A D_B
0 0 0 0 0 0 0 0 0
0 0 0 1 0 1 1 0 1
0 0 1 0 0 1 0 0 1
0 0 1 1 X X 0 1 1
0 1 0 0 0 1 0 0 1
0 1 0 1 1 0 1 1 0
0 1 1 0 1 0 0 1 0
0 1 1 1 X X 0 1 1
1 0 0 0 0 0 0 0 0
1 0 0 1 0 0 1 0 0
1 0 1 0 0 0 0 0 0
1 0 1 1 X X 0 1 1
1 1 0 0 0 1 0 0 1
1 1 0 1 0 1 1 0 1
1 1 1 0 0 1 0 0 1
1 1 1 1 X X 0 1 1
I did Karnaugh maps for the D_A, D_B, and z, and this is what I got (S=SYNC, D=DATA. S' means NOT SYNC):
D_A: AB+S'DB+S'DA
D_B: SD'+D'B+D'A+AB+S'DA'B'
z : A'B
I'm pretty sure of the Next State and z columns of my table; I've checked it against my teacher's answer. But somehow, the equations aren't working for me. Can you please check my work? Thanks in advance.
Last edited: