Hello,
I know how to make a decimal input by the standard method, making a lever for every possible number, but that gets pretty tedious and doesn't really functionally work.
I would like to figure out how to build something where it is easier to input the decimal inputs. I am thinking something like this, where there are multiple rows of 9:
Then I could make 12 (for example) in binary by selecting the top 1 and the bottom 2, all the way up to 99.
I've done some research on BCD, but while it looks like a good choice for a 7 segment output, it seems it would just be easier to do binary for the input in that case. A "decimal -- BCD -- binary" converter is acceptable, though, as long as there is a way to easily input decimal numbers into the machine.
I think my first approach would be to run a line of redstone dust behind each row of levers, then use the signal strength at one end as the row's value.
What you do with that signal strength depends on what you need this for. If you just want to run a 7-segment display, you could feed those values directly into analog-to-BCD decoders for each digit. If you want to combine the two rows into a single binary value, then you can use analog-to-binary decoders and use an adder to combine them.
I think my first approach would be to run a line of redstone dust behind each row of levers, then use the signal strength at one end as the row's value.
What you do with that signal strength depends on what you need this for. If you just want to run a 7-segment display, you could feed those values directly into analog-to-BCD decoders for each digit. If you want to combine the two rows into a single binary value, then you can use analog-to-binary decoders and use an adder to combine them.
I'm not very experienced with analog signals, so bear with me.
I currently plan on using it as an input to a calculator, so it will bus over to the beginning of the ALU. Naturally, I'd need this signal to be in binary, 8 bit in this case. Is there a way to convert analog to 8 bit binary? I can't find anything on the internet.
Also, you mention using an adder to combine them after converting them to binary. How would this work? One of the rows of levers is the 10s place and one is the 1s place, wouldn't decoding each separately and then adding them treat both lever rows as 1s places?
I had an idea for a non-analog way to do it. Would it be possible to have a zero place, and then put torches under the levers' wires all the way out to 99? It'd be tedious, big, and probably slow, but at least you'd have the fancy decimal input. After that you would just use a normal decimal-binary converter.
Okay, to convert it to 8-bit binary (though 7-bit would be enough?)…
So the 1s row can be converted easily using an A2B decoder. I have a couple examples on one of my wiki pages, depending on whether you're designing for speed or size.
For the 10s row, you'll need to decode it in such a way that the 10 lever powers the 2 and 8 binary lines, the 20 lever powers the 16 and 4 binary lines, the 30 lever powers the 16, 8, 4, and 2 binary lines, etc. Then you add that to the binary output of the 1s row.
Although somewhat large, the easiest way to convert from the 10s levers to binary is with manhattan wiring. Run all your input lines in one direction, run all your output binary lines underneath perpendicular to the input lines, and place torches at the appropriate intersections.
… I had an idea for a non-analog way to do it. Would it be possible to have a zero place, and then put torches under the levers' wires all the way out to 99? It'd be tedious, big, and probably slow, but at least you'd have the fancy decimal input. After that you would just use a normal decimal-binary converter.
You mean 99 torches? Signal strength only goes up to 15, so I'm not sure what you mean here.
EDIT: Anyway, the traditional way to build a calculator is to only have a single bank of button inputs from 0 to 9. Pressing a button multiplies the register value by 10 and adds the single digit. Basically each digit input is an operation, just like the multiply key, the sign key, etc.
Okay, to convert it to 8-bit binary (though 7-bit would be enough?)…
So the 1s row can be converted easily using an A2B decoder. I have a couple examples on one of my wiki pages, depending on whether you're designing for speed or size.
For the 10s row, you'll need to decode it in such a way that the 10 lever powers the 2 and 8 binary lines, the 20 lever powers the 16 and 4 binary lines, the 30 lever powers the 16, 8, 4, and 2 binary lines, etc. Then you add that to the binary output of the 1s row.
Although somewhat large, the easiest way to convert from the 10s levers to binary is with manhattan wiring. Run all your input lines in one direction, run all your output binary lines underneath perpendicular to the input lines, and place torches at the appropriate intersections.
You mean 99 torches? Signal strength only goes up to 15, so I'm not sure what you mean here.
No, have 99 output wires coming from the contraption, one for each decimal value (which then get converted into binary). You'd have to put torches on each lever's wire to power the wire under it, for example, for the number 12 you'd have a torch under 1 (10s place) and a torch under 2 (1s place). Not using analog, and not very effective compared to some other options here.
EDIT: Anyway, the traditional way to build a calculator is to only have a single bank of button inputs from 0 to 9. Pressing a button multiplies the register value by 10 and adds the single digit. Basically each digit input is an operation, just like the multiply key, the sign key, etc.
Interesting! I'll have to do more research on this. I think I'll continue the way I'm doing it for now, though.
So the 1s row can be converted easily using an A2B decoder. I have a couple examples on one of my wiki pages, depending on whether you're designing for speed or size.
Alright, I'm having trouble figuring this out. Is there a world download for the "fast a2b decoder?"
If not, I'm not entirely sure what the green blocks on the right are, or the pistons at the end. Also, where is the input supposed to be?
Sorry, no world download, but here's the original thread where Koala and I figured it out which has an extra picture.
The green blocks are just an analog clock to test the circuit, and the pistons are the output -- ignore them. The article is still in my userspace because it's still under construction and I haven't made a better picture yet.
The input is the first gold block on the right where the green blocks connect.
Sorry, no world download, but here's the original thread where Koala and I figured it out which has an extra picture.
The green blocks are just an analog clock to test the circuit, and the pistons are the output -- ignore them. The article is still in my userspace because it's still under construction and I haven't made a better picture yet.
The input is the first gold block on the right where the green blocks connect.
I know how to make a decimal input by the standard method, making a lever for every possible number, but that gets pretty tedious and doesn't really functionally work.
I would like to figure out how to build something where it is easier to input the decimal inputs. I am thinking something like this, where there are multiple rows of 9:
Then I could make 12 (for example) in binary by selecting the top 1 and the bottom 2, all the way up to 99.
I've done some research on BCD, but while it looks like a good choice for a 7 segment output, it seems it would just be easier to do binary for the input in that case. A "decimal -- BCD -- binary" converter is acceptable, though, as long as there is a way to easily input decimal numbers into the machine.
Is this at all possible?
What you do with that signal strength depends on what you need this for. If you just want to run a 7-segment display, you could feed those values directly into analog-to-BCD decoders for each digit. If you want to combine the two rows into a single binary value, then you can use analog-to-binary decoders and use an adder to combine them.
I'm not very experienced with analog signals, so bear with me.
I currently plan on using it as an input to a calculator, so it will bus over to the beginning of the ALU. Naturally, I'd need this signal to be in binary, 8 bit in this case. Is there a way to convert analog to 8 bit binary? I can't find anything on the internet.
Also, you mention using an adder to combine them after converting them to binary. How would this work? One of the rows of levers is the 10s place and one is the 1s place, wouldn't decoding each separately and then adding them treat both lever rows as 1s places?
I had an idea for a non-analog way to do it. Would it be possible to have a zero place, and then put torches under the levers' wires all the way out to 99? It'd be tedious, big, and probably slow, but at least you'd have the fancy decimal input. After that you would just use a normal decimal-binary converter.
So the 1s row can be converted easily using an A2B decoder. I have a couple examples on one of my wiki pages, depending on whether you're designing for speed or size.
For the 10s row, you'll need to decode it in such a way that the 10 lever powers the 2 and 8 binary lines, the 20 lever powers the 16 and 4 binary lines, the 30 lever powers the 16, 8, 4, and 2 binary lines, etc. Then you add that to the binary output of the 1s row.
Although somewhat large, the easiest way to convert from the 10s levers to binary is with manhattan wiring. Run all your input lines in one direction, run all your output binary lines underneath perpendicular to the input lines, and place torches at the appropriate intersections.
You mean 99 torches? Signal strength only goes up to 15, so I'm not sure what you mean here.
EDIT: Anyway, the traditional way to build a calculator is to only have a single bank of button inputs from 0 to 9. Pressing a button multiplies the register value by 10 and adds the single digit. Basically each digit input is an operation, just like the multiply key, the sign key, etc.
Good idea! I'll have to give it a try.
7 bit isn't quite enough, since if I were to add 99 and 99 it wouldn't be able to handle it. With 8 bit, there is a buffer zone.
No, have 99 output wires coming from the contraption, one for each decimal value (which then get converted into binary). You'd have to put torches on each lever's wire to power the wire under it, for example, for the number 12 you'd have a torch under 1 (10s place) and a torch under 2 (1s place). Not using analog, and not very effective compared to some other options here.
Interesting! I'll have to do more research on this. I think I'll continue the way I'm doing it for now, though.
Alright, I'm having trouble figuring this out. Is there a world download for the "fast a2b decoder?"
If not, I'm not entirely sure what the green blocks on the right are, or the pistons at the end. Also, where is the input supposed to be?
Thanks for your help so far!
The green blocks are just an analog clock to test the circuit, and the pistons are the output -- ignore them. The article is still in my userspace because it's still under construction and I haven't made a better picture yet.
The input is the first gold block on the right where the green blocks connect.
EDIT: I've added some schematics that should help you construct it.
Figured it out! Thanks so much for your help.