Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

60%
+1 −0
Q&A Division of binary numbers logic circuit

I dont understand how to make a logic circuit which does that job:check if the divisors is greater and equal or less than the most left digits of the divident So think about it. Break it down int...

posted 3y ago by Olin Lathrop‭  ·  edited 3y ago by Olin Lathrop‭

Answer
#2: Post edited by user avatar Olin Lathrop‭ · 2021-08-08T12:30:26Z (about 3 years ago)
  • <blockquote>I dont understand how to make a logic circuit which does that job:check if the divisors is greater and equal or less than the most left digits of the divident</blockquote>
  • So <i>think</i> about it. Break it down into small chunks. Let's ignore the reason behind your question and try to make a digital block that compares two unsigned binary numbers and tells you either A > B, A = B, or A < B.
  • Start with the highest bit. There are four possible cases. Write a truth table to show the action in each possible case:
  • <pre>
  • A B action
  • --- --- ----------------
  • 0 0 can't tell, need to look at lower bits.
  • 0 1 A < B, done.
  • 1 0 A > B, done.
  • 1 1 can't tell, need to look at lower bits.
  • </pre>
  • You should be able to see how this per-bit logic can be chained, starting from the highest bit down to the lowest bit. At any point where the middle two cases in the truth table above are found, the process terminates with a definitive answer. Or, you could say that the result of comparing that bit overrides any output from the results of comparing lower bits.
  • If you get all the way to the end without a definitive answer, then the two values are equal.
  • Joel Reyes Noche has already told you this is a standard block called a "comparator". Personally, I've seen this called a "magnitude comparator". That may help you search for more material on it out there.
  • <blockquote>I dont understand how to make a logic circuit which does that job:check if the divisors is greater and equal or less than the most left digits of the divident</blockquote>
  • So <i>think</i> about it. Break it down into small chunks. Let's ignore the reason behind your question and try to make a digital block that compares two unsigned binary numbers and tells you either A > B, A = B, or A < B.
  • Start with the highest bit. There are four possible cases. Write a truth table to show the action in each possible case:
  • <pre>
  • A B action
  • --- --- ----------------
  • 0 0 can't tell, need to look at lower bits.
  • 0 1 A < B, done.
  • 1 0 A > B, done.
  • 1 1 can't tell, need to look at lower bits.
  • </pre>
  • You should be able to see how this per-bit logic can be chained, starting from the highest bit down to the lowest bit. At any point where the middle two cases in the truth table above are found, the process terminates with a definitive answer. Or, you could say that the result of comparing that bit overrides any output from the results of comparing lower bits.
  • If you get all the way to the end without a definitive answer, then the two values are equal.
  • Joel Reyes Noche has already told you this is a standard block called a "digital comparator". Personally, I've seen this called a "magnitude comparator". That may help you search for more material on it out there.
#1: Initial revision by user avatar Olin Lathrop‭ · 2021-08-08T12:29:49Z (about 3 years ago)
<blockquote>I dont understand how to make a logic circuit which does that job:check if the divisors is greater and equal or less than the most left digits of the divident</blockquote>

So <i>think</i> about it.  Break it down into small chunks.  Let's ignore the reason behind your question and try to make a digital block that compares two unsigned binary numbers and tells you either A > B, A = B, or A < B.

Start with the highest bit.  There are four possible cases.  Write a truth table to show the action in each possible case:

<pre>
  A     B   action
---   ---   ----------------
  0     0   can't tell, need to look at lower bits.
  0     1   A < B, done.
  1     0   A > B, done.
  1     1   can't tell, need to look at lower bits.
</pre>

You should be able to see how this per-bit logic can be chained, starting from the highest bit down to the lowest bit.  At any point where the middle two cases in the truth table above are found, the process terminates with a definitive answer.  Or, you could say that the result of comparing that bit overrides any output from the results of comparing lower bits.

If you get all the way to the end without a definitive answer, then the two values are equal.

Joel Reyes Noche has already told you this is a standard block called a "comparator".  Personally, I've seen this called a "magnitude comparator".  That may help you search for more material on it out there.