Off Topic > Creativity
I've designed a circuit board and soldered all the pieces.
Placid:
--- Quote from: Meldaril on April 19, 2017, 11:46:58 PM ---I'm surprised you're not studying computer science. At my university, they taught us how to build a CPU from first principles in the second year so I'd imagine you would probably find the first year very easy going.
--- End quote ---
this! good stuff OP, I'm impressed (that project destroyed me LOL)
I might have some screenshots from it if anyone's interested. I think it ran on MIPS architecture?
DrenDran:
--- Quote from: Placid on June 07, 2017, 02:21:37 PM ---this! good stuff OP, I'm impressed (that project destroyed me LOL)
I might have some screenshots from it if anyone's interested. I think it ran on MIPS architecture?
--- End quote ---
Sure, I'd like to see some.
Anyway, here's some renderings of the first board I hope to have produced:
I'll probably have to have like 10 different boards made and then wire them together.
This handles the USB power supply, clock, step counter, 5->22 line opcode decoding, user interface, and interrupt handling.
Placid:
--- Quote from: DrenDran on June 07, 2017, 03:11:03 PM ---Sure, I'd like to see some.
--- End quote ---
Expecting massive page stretch so click for full view. Didn't have to do any actual physical wiring thank god, this was pre-implementation of pipelining, don't think I have anything after this. The program outputs an address which the harness uses to find an instruction as an input, couldn't find the harness .circ file but all it would do is have a memory lookup of the output ("fetch_addr") and feed that output back into the cpu (as "INSTRUCTION"). If you're not familiar with this kind of architecture: it'll first pass through instruction fetch to get an instruction from the PC, then goes to instruction decoder where it's dissected into parts, looks up registers and passes opcode/func through controller, executes code & then writes back to memory/registers. There's a bunch of extra circuitry to handle immediates (i.e. constants) and program flow (i.e. jumping, returning) but that's the gist of it.
Also the controller was super dumb/tedious to implement as it involved basically hardcoding based on opcode and function code so I didn't put it in any screenshots, but it basically tells the ALU what to do/defines other cpu behavior based on what the operation specified by an instruction is
(but dear lord why would you do this to yourself... this class was the death of me, i couldn't imagine ever doing this for fun)
DrenDran:
How's this look for an instruction set?
0 - No Operation
1 - Const to gen register
2 - Memory to gen reg
3 - Gen reg to alu reg A
4 - Gen reg to alu reg B
5 - Alu add to gen reg
6 - Alu OR to gen reg
7 - Alu AND to gen reg
8 - Alu NOT to gen reg
9 - Alu LEFT to gen reg
10 - Alu RIGHT to gen reg
11 - Gen reg to compare reg
12 - Compare to gen reg
13 - Jump unconditionally
14 - Jump if greater than
15 - Gen reg to display
16 - Gen reg to expansion
17 - Expansion to gen reg
18 - Trigger expansion
19 - Gen reg to memory
20 - Jump if less than
21 - Jump if equal
22 - Return to after last jump
23 - Wait to continue
The top two bits of an instructions word would select one of 4 general registera where applicable. The bottom 5 bits choose the opcode.
DrenDran:
Tonight I do my first soldering.