I already know how to make a device that can detect if an incoming signal is a specific binary number, but how do I make it test for >Greater than <Less than inequalities. Any tutorials I should be watching?

By flag, do you mean booleans that keep track of each bit and whether it is greater than the other one.

Lets say we are comparing which one is greater out of these 2 binary numbers.

1010100

0010011

Are you saying I need to break down each number bit by bit and use a flag for each bit to know which one is greater, then look at the results to determine if number A (top) is greater or less than number B (bottom)?

If that is the case, how exactly should I design this thing? And lets do something simple like comparing two four bit numbers as an explanation.

The Meaning of Life, the Universe, and Everything.

Join Date:
5/12/2015

Posts:
63

Member Details

Sorry, the link I gave you doesn't give a good explanation of expanding to multiple bits at all.

Chaining them makes it a bit more complex, mostly for the inequality tests.

So lets say our two numbers A and B both have n-bits. Individual digits are numbered A_{n}, A_{n-1}, ... A_{1.
}The test for equality is simply an AND gate for all the outputs from A_{n}=B_{n} down to A_{1}=B_{1}. (A_{n}=B_{n})(A_{n-1}=B_{n-1})....(A_{1}=B_{1})

Inequality gets more complex, you look at the most significant bit first, if A_{n}>B_{n }then A>B, but if those bits are the same (A_{n}=B_{n}) then you have to look at the next bit (moving right). So the test for the second bit would check that (A_{n}=B_{n}) AND (A_{n-1}>B_{n-1}). If that is false, you have to move on to the next bit until you get to the least significant bit. Each of these individual bit tests are one big OR.

Fortunately you only have to go through this test for either A<B or A>B, because if A>B and A=B are false then A<B will be true so one NOR gate will give you the third output.

Its not that complicated. I don't remember exactly how I made mine but I think Grizedale has a design. I took one input off the final result and one off from the carry-out. The only way it would work is if my adders were in two's complement(subtraction) mode. If I get a chance back on my world I will make a video. The problem is that I wont be able to use my Xbox at the moment as I have places to go.

I honestly don't know. I looked around for one but cant find one. I will eventually put one up since I need to anyway. Try to learn things from an engineering aspect. Do that and bring that knowledge into Minecraft and you can do some really cool things.

I already know how to make a device that can detect if an incoming signal is a specific binary number, but how do I make it test for >Greater than <Less than inequalities. Any tutorials I should be watching?

When Steam finishes a big game.

http://www.electronics-tutorials.ws/combination/comb_8.html

You're going to want to use flags. If you have Full-Adders than you can just pull the flags out of certain outputs.

Build Planes, Boats, Cars, Airships and fight!

By flag, do you mean booleans that keep track of each bit and whether it is greater than the other one.

Lets say we are comparing which one is greater out of these 2 binary numbers.

1010100

0010011

Are you saying I need to break down each number bit by bit and use a flag for each bit to know which one is greater, then look at the results to determine if number A (top) is greater or less than number B (bottom)?

If that is the case, how exactly should I design this thing? And lets do something simple like comparing two four bit numbers as an explanation.

When Steam finishes a big game.

Sorry, the link I gave you doesn't give a good explanation of expanding to multiple bits at all.

Chaining them makes it a bit more complex, mostly for the inequality tests.

So lets say our two numbers A and B both have

n-bits. Individual digits are numbered A_{n}, A_{n-1}, ... A_{1. }The test for equality is simply an AND gate for all the outputs from A_{n}=B_{n}down to A_{1}=B_{1}. (A_{n}=B_{n})(A_{n-1}=B_{n-1})....(A_{1}=B_{1})Inequality gets more complex, you look at the most significant bit first, if A

_{n}>B_{n }then A>B, but if those bits are the same (A_{n}=B_{n}) then you have to look at the next bit (moving right). So the test for the second bit would check that (A_{n}=B_{n}) AND (A_{n-1}>B_{n-1}). If that is false, you have to move on to the next bit until you get to the least significant bit. Each of these individual bit tests are one big OR.Wikipedia has a good explanation http://en.wikipedia.org/wiki/Digital_comparator. Look at the "inequality" section on the bottom of the page.

Fortunately you only have to go through this test for either A<B or A>B, because if A>B and A=B are false then A<B will be true so one NOR gate will give you the third output.

Its not that complicated. I don't remember exactly how I made mine but I think Grizedale has a design. I took one input off the final result and one off from the carry-out. The only way it would work is if my adders were in two's complement(subtraction) mode. If I get a chance back on my world I will make a video. The problem is that I wont be able to use my Xbox at the moment as I have places to go.

Build Planes, Boats, Cars, Airships and fight!

Is there any tutorial I can refer to?

When Steam finishes a big game.

I honestly don't know. I looked around for one but cant find one. I will eventually put one up since I need to anyway. Try to learn things from an engineering aspect. Do that and bring that knowledge into Minecraft and you can do some really cool things.

Build Planes, Boats, Cars, Airships and fight!

I guess right now the best option is to look up a computer design tutorial and look for a section where they build this inequality testing system.

When Steam finishes a big game.