My brand new 4-bit computer

Programming, for all ages and all languages.
embryo

Re: My brand new 4-bit computer

Post by embryo »

bwat wrote:I'm a programmer, so if it can be programmed, then I want one. I justify it by calling it deliberate practice. The older machines have constraints which lead to techniques being used that you just don't see anywhere else.
It's important skill to be able to cope with limited resources, but may be such skill can be used in a neat combination with others? If it is the hardware level that is interesting for a programmer, then I see here an opportunity to learn many things about processors, caches, memory controllers and so on. But to learn it the hardware is not required, at least when the programmer can build an emulator. Actually, the hardware behaviour is relatively simple - just 0 and 1 states on the chip's pins with some logic attached to the state interdependencies. So, for me, it is more interesting to create a simple emulator of an imaginable processor. And the processor can be of any architecture, just as complex as you wish. This is not only programming experience, but it introduces you into the world of the processor architecture and lets you feel the magic of a hardware designer.

For me it is interesting to emulate an 'open' processor, when there are a lot of simple units like adder or subtracter and all them are connected with many internal buses. After having such basic design it is possible to move to the cache emulation, then to the memory controller and PC's main bus and so on. In such a way the hardware will be covered in great details and without the need for expensive hardware to debug it (like complex oscilloscope and many other things). Next, after the basic hardware is emulated, it is possible to start digging into the area of compilers. And if you see that the resulting system performance can be improved with a new hardware design - you just have everything in place to implement it.

As I remember there was an interest in high level logic like is implemented in prolog or lisp - all this can be used for the hardware emulation and the compiler development. So, you can leverage your knowledge even better.

And even for beginners such starting point (as a hardware emulation) will be a really good learning experience without losing time for a tricky hardware debugging.

And it is possible to get even bigger picture - if many programmers will do such a beast, then there is a plenty of space for collaboration and team work experience. Socializing the computer science is an interesting goal. And one part of it has been completed here by starting this forum.
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: My brand new 4-bit computer

Post by bwat »

embryo wrote:
bwat wrote:I'm a programmer, so if it can be programmed, then I want one. I justify it by calling it deliberate practice. The older machines have constraints which lead to techniques being used that you just don't see anywhere else.
It's important skill to be able to cope with limited resources, but may be such skill can be used in a neat combination with others?
Have you heard of requisite variety? http://requisitevariety.co.uk/what-is-r ... e-variety/ By doing these sorts of things, you're increasing your variety, becoming more complex. As for limited resources, within arms reach of me right now I can find 8 cheapo microcontrollers that have limited I/O ports (PICs, ATmega) that are just sitting there waiting to be used in some project. Actually, limited is a relative term, there's always a bigger application out there that'll make even the most expensive machine look limited.
embryo wrote: For me it is interesting to emulate an 'open' processor, when there are a lot of simple units like adder or subtracter and all them are connected with many internal buses. After having such basic design it is possible to move to the cache emulation, then to the memory controller and PC's main bus and so on.

In the field of processor design, I can say that hardware emulation, i.e abstract machines implemented in software, is no longer interesting to me. Big enough FPGAs have become so cheap and easy to use that I'm no longer building abstract machines. A C programmer can pick up behavioural Verilog very quickly. Structural Verilog if needed isn't that much harder to learn. I used to think software emulation would be faster and easier to develop but my mind has been changed.
embryo wrote:In such a way the hardware will be covered in great details and without the need for expensive hardware to debug it (like complex oscilloscope and many other things).
FPGA design is first-world cheap. Of course, you could be doing things that need expensive extras so I won't tell you you don't need them but it may be the case that you might not need as much as you think you do.
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: My brand new 4-bit computer

Post by bwat »

LieutenantHacker wrote:From the post title I had assumed you meant that you made your own 4-bit computer (from scratch). I'm going to assemble an 8-bit one, and use a 16x32 LED-matrix for graphical display. Will take quite a while, but it's my first goal!
I had a very quick look at your instructables link. That design looks quite - actually very - flexible. I wonder why (s)he didn't just use a 74181 ALU (http://www.ti.com/general/docs/lit/getl ... er=sdls136), there's more than a few on ebay. With a proper 8-bit ALU you could build something half decent with that basic design.

As for your output, have you seen the old Nokia 5110 LCDs that you can get on ebay for very little (http://www.ebay.co.uk/itm/84x48-Pixel-L ... 20dce2d63d). Much cheaper than an LED matrix. Do you really want to connect 512 LEDs?

I'm slowly gathering parts for an 8-bit 8085 computer - I've got my RAM and EEPROM chips already. Now I'm just waiting for the postman to deliver the 8085 and some logic chips. Again, everything bought dirt cheap on ebay. Maybe when that's done I'll attempt my own CPU in '74 logic.
Every universe of discourse has its logical structure --- S. K. Langer.
embryo

Re: My brand new 4-bit computer

Post by embryo »

bwat wrote:Have you heard of requisite variety?
First there is a model. And only after it there is a hardware. The skill of mapping model to the hardware is interesting and useful, but it seems trivial with all those verilogs and other stuff - just write your model in some language and you have the hardware. That's why my choice is with the model part. But at least somebody, of course, should go farther - to the actual hardware. For me this step is not yet actual, may be some time in the future...
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: My brand new 4-bit computer

Post by qw »

bwat wrote:Let me guess, you've never had major problems with pointers in C.
Indeed, and neither with static, automatic and dynamically allocated memory, octal and hexadecimal numbers, the register keyword, etc.
Post Reply