Building a 2's complementer (need help visualising how to make a state diagram and table). Implementing a circuit to find the complement is driving me crazy. I'm given a shift register (that stores my binary number) and a flip flop (using D for simplicity). Serial incrementer. Starting with the least-significant bit, shift one bit at a.
Active8 years, 4 months ago
$begingroup$
Just to be fair, this is a previous exam question and was an assignment question. I've already handed in the assignment and now I'm trying to see why I got it wrong -- to study for my final.
https://kkpowerup479.weebly.com/scrivener-mac-vs-pc.html. I fully understand how to find the 2's complement of a binary number, however, implementing a circuit to find the complement is driving me crazy. I'm given a shift register (that stores my binary number) and a flip flop (using D for simplicity). The process I follow for building sequential circuits is this:
I'm trying to visualize how to actually draw the state diagram for this complementer. I know it depends on the previous value and stuff, but if someone could take the time to explain in plain english how he/she would go about building the state diagram, I would be vey grateful.
n0pe
n0pe
![]()
49033 gold badges88 silver badges2222 bronze badges
$endgroup$
Serial 2 S Complementer Shift Register Online3 Answers![]()
That link you gave says it all:
Hint: - 2’s complement of a number can be obtained by keeping the least significant bits as such until the first 1, and then complementing all bits
'example 001010 → 110110' that is to say
So there are two states - 'I haven't seen a one yet' and 'I have seen a one previously'. Given my state and my current input, my output and next state are fully determined.
If my current state is 'I haven't seen a one yet' and my input is a 0, my output is a 0 and my next state is (still) 'I haven't seen a one yet' Cara install stick ps2 ultraman di pc.
If my current state is 'I haven't seen a one yet' and my input is a 1, my output is a 1 and my next state is (changes to) 'I have seen a one previously' Gordis l. 2009 epidemiology 4th edition elsevier health sciences.
If my current state is 'I have seen a one previously' and my input is a 0, my output is a 1 and my next state is (still) 'I have seen a one previously'
If my current state is 'I have seen a one previously' and my input is a 1, my output is a 0 and my next state is (still) 'I have seen a one previously'
Write that out as a truth table encoding 'I haven't seen a one yet' as 0 and 'I have seen a one previously' as 1, and you should be home free.
To 'wire it up' the current data input bit and the current state go into logic that feeds the input to the D-flip flop and separate logic that feeds the input to the shift register, the D-flip-flop holds the 'state variable', and both are clocked by the data clock. And to be complete you need some kind of reset logic - left as an exercise to the reader. The 'current state' is the output of the D-flip-flop, and next state is the input to it..
vicatcuvicatcu
16.5k88 gold badges6363 silver badges134134 bronze badges
$endgroup$$begingroup$
You know the 2's complement of each of the binary values 0000, 0001, 0010, 0011, .. 1111, right?
There are at least 2 ways to get the 2's complement of a number in a SIPO shift register:
When adding 2 bits, the Carry_out is 1 only when both bits are 1; otherwise the Carry_out is zero.
davidcarydavidcary
14.8k88 gold badges5353 silver badges100100 bronze badges
$endgroup$$begingroup$
state diagram is just the output to next
for a mod 3 count up counter the state diagram would be
000 -> 001 -> 010 -> back to 000
Serial 2 S Complementer Shift Register Of Deeds
since it counts from 0 to 2 and reset on 3
ricedragonricedragon
$endgroup$
Serial 2's Complementer Shift RegisterNot the answer you're looking for? Browse other questions tagged digital-logic or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |