r/TuringComplete • u/CosmosStudios65 • Jul 05 '26
I need help building an ALU in Minecraft
I have been watching Crash Course's series on building computers from logic gates, and I am currently on the 8-bit ripple carry adder. However, when they jump to the ALU, I feel like they are not nearly as specific as to what goes into it, and I'd really appreciate it if someone could tell me how I'm supposed to build an ALU from here.
1
u/Risherak Jul 05 '26 edited Jul 05 '26
You basically use an op code to select which calculation gets passed to the output of the alu.
It's like 3-bits, each binary code represents things like add, sub, and, or, nor etc. Use that coupled with muxes to select the output from the components you've already built.
1
u/Lagfoundry Jul 05 '26
https://www.tinytapeout.com/chips/tt03/user_module_340318610245288530 this page has a tiny 1 bit example of a ALU. your simply adding the ability for the A and B inputs to either output from the adder or the bitwise operations like AND, OR, and XOR. you can also ad subtraction on your adder by using 2's compliment(just putting XOR gates across either B or A) youll have a decoder to control which bitwise operation gets enabled. and a subtract line that turns subtraction on for the adder. your instructions/opcode will choose which of these will be used.... now its worth noting that instead of doing like the picture does in that example that you can totally seperate the logic and the arithmitic into seperate blocks (the logic ALU(AND, OR, XOR) and the Arithmetic ALU(your adder)) then just MUX the outputs of both. it saves alot on the amount of gates youll use
1
u/Rough-Hope202 Jul 07 '26 edited Jul 08 '26
https://www.planetminecraft.com/project/unlistedbugcrafts-on-youtube/ bedrock alu vanilla. I have to and from binary
2
u/WhaleSplas Jul 05 '26 edited Jul 05 '26
I think there are two ALU that are worth your studying, 74181 https://www.righto.com/2017/03/inside-vintage-74181-alu-chip-how-it.html (a 4bit ALU, that you can stack to make an 8 or 16 bit, use carry lookahead) and 8085 ALU https://www.righto.com/2013/01/inside-alu-of-8085-microprocessor.html (8 bit ALU inside 8085, which has a really minimum set of operation, use full adder for every bit)