3 ms·
kind of makes me want to sit down and take a swing at building one myself
by noodle 17y ago
kind of makes me want to sit down and take a swing at building one myself
- ovi256 17y agoEven better idea : write a CPU simulator! Just a while loop that reads assembler from a file and interprets it on a virtual CPU. I did this in Java a while ago, I reproduced a few Intel x86 ASM instructions. MOV, CMP and JMP are all you need for Turing completeness, if I recall correctly. You could make up your own assembly language. Next easy step : add a memory-mapped bitmap display to your virtual machine. Bochs watch out! After that, write a compiler for your favourite language towards your assembler and watch it run on your CPU. Then a debugger. Then you would be more awesome than Zed Shaw.
- DLWormwood 17y agoEven better idea : write a CPU simulator! Just a while loop that reads assembler from a file and interprets it on a virtual CPU. I did this in Java a while ago, I reproduced a few Intel x86 ASM instructions. MOV, CMP and JMP are all you need for Turing completeness, if I recall correctly. I actually had to work with one of these for a class in college. My project was to create a compiler for a fictional assembly language, and emit object code for a finctional processor. While I got basic stuff like move, load and add working, I never got branching to work right... /-: (The only C I ever got in a computer related class.)
- ricree 17y agoOr if you're more hardware inclined but don't feel up to spending the time and money needed to make a wire wrapped cpu, I'd recommend learning vhdl or verilog and designing a cpu in that. It's at the logical level rather than physical, but it will still let you get a feel for the factors that go into designing a processor, and it is easier to add in more advanced aspects to the design.
- gchpaco 17y agoOnce upon a time, I hacked a simulator and an assembler for the Pendulum chip. It was an interesting and fun project in a lot of ways, but fair warning: the example program that computes Fibonacci numbers, I think, is wrong, and correcting that loop was not difficult per se but it was sure mind bending.
- alain94040 17y agoWhat I'd love to see is someone invent an assembly language that is reversible. Meaning that if you execute the code backward, you undo whatever the code was doing. This way, the undo function of office becomes trivial to implement! (minus some IO issues)
- abecedarius 17y agoI've written a simulator for one (not of my own design): http://www.accesscom.com/~darius/hacks/pisa.tar.gz http://www.accesscom.com/~darius/hacks/pisa.tar.gz
- noodle 17y agoalready made a c-based simulator. would like to do some hands-on hardware work. good idea, though.
- ludwig 17y agoActually, you only need one instruction for Turing completeness: http://en.wikipedia.org/wiki/One_instruction_set_computer http://en.wikipedia.org/wiki/One_instruction_set_computer
- swolchok 17y agoAren't you going to need somewhat to actually calculate things? NAND would do it.