Page 1 of 2
My brand new 4-bit computer
Posted: Mon Apr 07, 2014 8:27 am
by bwat
Just got my newest computer, a GMC-4 which has a 4-bit processor. Yep, 4-bit! The computer is actually part of a glossy magazine and toy combination which is part of a
science for adults series and this particular issue was about early computing. It's a shame I can't read Japanese as the magazine looked half interesting. The English manual is here:
http://otonanokagaku.net/english/manual ... puter.pdf
On page 12 you see the OS calls - the opcodes from E0 to EF.
What you don't see from the manual or web images are the little exposed metal pads that you could use to hack the machine by soldering things onto the board. Quite cool for a cheap toy! After some surfing I discovered that the GMC-4 seems to be the same as this
microcomputer trainer.
All in all, not as much fun as an Arduino but still a good time killer and worth the money just to say you own a 4-bit machine.
ps. I bought it on ebay. Search for Gakken 4-bit computer and you'll probably see it.
Re: My brand new 4-bit computer
Posted: Mon Apr 07, 2014 3:38 pm
by Nable
Hmm, the only idea in it is "8+ -bit machines are too mainstream", isn't it?
Re: My brand new 4-bit computer
Posted: Tue Apr 08, 2014 2:27 am
by bwat
Nable wrote:Hmm, the only idea in it is "8+ -bit machines are too mainstream", isn't it?
I've sold it short. It's an educational tool. The magazine and the computer, along with user supplied screwdriver and 3*AA battery, gives you everything you need to go from not having a clue about computers to assembly language programming. I can only go from what the pictures in the magazine tell me - I can't read Japanese - but it seems to cover binary and hex representations of numbers, basic gates (AND, OR, NOT), how to use these basic gates to build a half adder and a full adder, a description of the CPU datapath (the control unit isn't covered graphically, might be written about but again I can't tell), how to create a flow chart, how to convert a flow chart into opcodes and machine code, and how to enter, edit, and run your programs.
Actually, it's not too dissimilar to what
I used at school to do the same sort of things. To be honest I'm not sure if this is the exact 6502 trainer we used but it's close enough.
Re: My brand new 4-bit computer
Posted: Tue Apr 08, 2014 2:33 am
by embryo
So, you're just refreshing your old days knowledge? It sounds not very intriguing when somebody reads a book once more. There should be something new. Is it there?
Re: My brand new 4-bit computer
Posted: Tue Apr 08, 2014 2:34 am
by Bender
embryo wrote:
So, you're just refreshing your old days knowledge? It sounds not very intriguing when somebody reads a book once more. There should be something new. Is it there?
Being Nostalgic is different from reading a book once more.
Do any of you guys know if 4-bit computers are still in use? You know, in Software Industry anything can happen...
Re: My brand new 4-bit computer
Posted: Tue Apr 08, 2014 3:07 am
by bwat
embryo wrote:
So, you're just refreshing your old days knowledge? It sounds not very intriguing when somebody reads a book once more. There should be something new. Is it there?
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. As an example: on this machine, and on another 8-bit kit computer I've got coming my way, the designers use
"dynamic lighting", one output port is demultiplexed between several groups of LEDs as there are so few ports. You don't see that much these days!
Bender wrote:
Being Nostalgic is different from reading a book once more.
It's definitely not nostalgia. Entering machine code by hand isn't fun.
Re: My brand new 4-bit computer
Posted: Tue Apr 08, 2014 3:52 am
by Bender
Entering machine code by hand isn't fun.
For me it definitely is.
Re: My brand new 4-bit computer
Posted: Tue Apr 08, 2014 4:46 am
by iansjack
Bender wrote:Entering machine code by hand isn't fun.
For me it definitely is.
Have you done a lot of hand machine-coding? (Not assembler, machine code.)
It really isn't fun. Even less so if you have to do it by flipping switches on a front panel.
Re: My brand new 4-bit computer
Posted: Tue Apr 08, 2014 4:52 am
by Bender
iansjack wrote:Bender wrote:Entering machine code by hand isn't fun.
For me it definitely is.
Have you done a lot of hand machine-coding? (Not assembler, machine code.)
It really isn't fun. Even less so if you have to do it by flipping switches on a front panel.
I don't know if you'll consider that really machine-code but I have programmed in Java ByteCode, (with typing instructions by hand, not much but I do see people who're 30-40+ here, and they may have programmed in machine code in absence of compilers/assemblers).
Sure it's difficult, but sometimes difficult things can get fun.
Re: My brand new 4-bit computer
Posted: Tue Apr 08, 2014 5:12 am
by bwat
Bender wrote:I don't know if you'll consider that really machine-code but I have programmed in Java ByteCode, (with typing instructions by hand, not much but I do see people who're 30-40+ here, and they may have programmed in machine code in absence of compilers/assemblers).
Sure it's difficult, but sometimes difficult things can get fun.
The problem comes when you input the wrong byte. With a text editor you can see it and fix it easily. With a numeric keypad and a couple of 7-segment displays, or as iansjack describes, switches and LEDs, you have to go through each address one at a time and compare the memory contents with your binary program looking for some discrepancy that explains your program's erroneous behaviour. It's fun the first time but you soon learn to be careful. You also learned to put in a bunch of NOPs at strategic places so you could patch code in situ. I think alot of younger programmers aren't sure why we have NOPs.
Our teacher made us hand assemble everything and that was fine for small programs but, again, you learned to be careful calculating your jump offsets and your translation from assembly to machine code - line by line, check and double check. We never really did more than a 50 or so lines of assembly IIRC. The funny thing is we had machines which could have run assemblers for us!
Re: My brand new 4-bit computer
Posted: Tue Apr 08, 2014 5:26 am
by qw
Nice. In the early 80's a Dutch popular-scientific magazine distributed those, or something similar. My introduction to assembly. Calculating machine code manually sure was a pita but it was a sound introduction into how CPU's work. For educational purposes, I still think that's very valuable.
Re: My brand new 4-bit computer
Posted: Tue Apr 08, 2014 5:27 am
by Bender
The problem comes when you input the wrong byte. With a text editor you can see it and fix it easily. With a numeric keypad and a couple of 7-segment displays, or as iansjack describes, switches and LEDs, you have to go through each address one at a time and compare the memory contents with your binary program looking for some discrepancy that explains your program's erroneous behaviour.
That could be more difficult than I imagine, it was a tiring job sometimes?
You also learned to put in a bunch of NOPs at strategic places so you could patch code in situ. I think alot of younger programmers aren't sure why we have NOPs.
You just answered my doubt about what I called a "useless" instruction which would've been a gift to programmers at that time.
Our teacher made us hand assemble everything and that was fine for small programs but, again, you learned to be careful calculating your jump offsets and your translation from assembly to machine code - line by line, check and double check. We never really did more than a 50 or so lines of assembly IIRC. The funny thing is we had machines which could have run assemblers for us!
Assemblers and Compilers were proprietary during that time (I guess), and only accessible to major corporations, was that the reason you were made to program in machine code, or ....?
Re: My brand new 4-bit computer
Posted: Tue Apr 08, 2014 5:49 am
by bwat
Hobbes wrote:
Nice. In the early 80's a Dutch popular-scientific magazine distributed those, or something similar. My introduction to assembly. Calculating machine code manually sure was a pita but it was a sound introduction into how CPU's work. For educational purposes, I still think that's very valuable.
Let me guess, you've never had major problems with pointers in C. We probably worked on the same trainer. I'm not 100% sure it was a KIM-1 we had but it was pretty close. I actually remember it being more cardboard than circuit board!
Bender wrote:Assemblers and Compilers were proprietary during that time (I guess), and only accessible to major corporations, was that the reason you were made to program in machine code, or ....?
We had BBC model Bs and
according to wikipedia BBC basic had a built in assembler. We could have taken turns on the BBC just like we had to take turns on the machine we were programming. They probably thought that doing it by hand would teach us more. I can still remember certain 6502 opcodes after all these years.
Re: My brand new 4-bit computer
Posted: Tue Apr 08, 2014 11:57 am
by LieutenantHacker
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!
Re: My brand new 4-bit computer
Posted: Tue Apr 08, 2014 9:18 pm
by AndrewAPrice
That's pretty cool. You might also be interested in the Parallax Propeller -
http://www.parallax.com/microcontrollers/propeller-original-equipment-manufacturer-oem 8 cores! That seemed so cool back in 2006.
When you see microcontrollers that are $1 each, I've wondered about building a 1024-core computer of 1 MHz processors - until I researched into wiring the thing together!