My brand new 4-bit computer

Programming, for all ages and all languages.
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

My brand new 4-bit computer

Post 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.
Every universe of discourse has its logical structure --- S. K. Langer.
Nable
Member
Member
Posts: 453
Joined: Tue Nov 08, 2011 11:35 am

Re: My brand new 4-bit computer

Post by Nable »

Hmm, the only idea in it is "8+ -bit machines are too mainstream", isn't it?
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 »

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.
Every universe of discourse has its logical structure --- S. K. Langer.
embryo

Re: My brand new 4-bit computer

Post by embryo »

bwat wrote: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.
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?
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: My brand new 4-bit computer

Post by Bender »

embryo wrote:
bwat wrote: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.
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...
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
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: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.
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.
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: My brand new 4-bit computer

Post by Bender »

Entering machine code by hand isn't fun.
For me it definitely is. 8)
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
iansjack
Member
Member
Posts: 4689
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: My brand new 4-bit computer

Post by iansjack »

Bender wrote:
Entering machine code by hand isn't fun.
For me it definitely is. 8)
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.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: My brand new 4-bit computer

Post by Bender »

iansjack wrote:
Bender wrote:
Entering machine code by hand isn't fun.
For me it definitely is. 8)
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. :)
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
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 »

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!
Every universe of discourse has its logical structure --- S. K. Langer.
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:Actually, it's not too dissimilar to what I used at school to do the same sort of things.
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.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: My brand new 4-bit computer

Post 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 ....?
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
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 »

Hobbes wrote:
bwat wrote:Actually, it's not too dissimilar to what I used at school to do the same sort of things.
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.
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
LieutenantHacker
Member
Member
Posts: 69
Joined: Sat May 04, 2013 2:24 pm
Location: Canada

Re: My brand new 4-bit computer

Post 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!
The desire to hack, with the ethics to code.
I'm gonna build an 8-bit computer soon, with this as reference: http://www.instructables.com/id/How-to- ... -Computer/
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: My brand new 4-bit computer

Post 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!
My OS is Perception.
Post Reply