• Question: how did the first computer's transistors know how to obey decimal and binary code?

    Asked by to Ian on 24 Jun 2014. This question was also asked by .
    • Photo: Ian Stephenson

      Ian Stephenson answered on 24 Jun 2014:


      How computers know how to obey instructions is my favourite question… It’s also a really hard question to get a good answer to.

      When I was at school I wanted to know the same thing, and I read LOTS of books on computers and electronics…. and I didn’t find the answer. There are lots of good books on electronics which will tell you about logic gates, and lots of good books on low level computing which will tell you about instructions, but virtually none which explain how you can use logic to build a PROGRAMMABLE machine. I ended up studying electronics at university essentially looking for the answer to that question! I sort of got the answer there, though even then it was skipped over quite quickly.

      Ideally I’d recommend you take the unit I teach to first year computer graphics students which covers this exact topic from start to finish, but it takes about 30 hours to explain it…

      To try and sum that up… computers have “registers” which can each hold a number. They also have an ALU which can add numbers together. We put these together with some other stuff to make a “register transfer machine”. This basically gives us a way to move numbers from a register to the ALU, and then take the result of the calculation and move it back to a register.

      A computer “instruction” basically tells the computer where to move the value from and where to move it to. So an instruction “34” might mean move from register number 3, to register number 4. A computer program is just a long sequence of instructions telling the computer to move things around between registers, and add registers together.

      The only other thing you really need is a mechanism to say “move register A to register B _IF_ register C is 0”, and you’ve got something that is a computer.

      If you want to know more then the book “Code” by Charles Petzold is great. It’s a pretty easy read, and has a lot of cool historical stuff in too. It does get a bit off track in places, and there are some bits that I think could be done better, but its one of the few books to actually tackle this.

      The other great book is “Computational Structure”, but that’s a text book written for university engineering students – its amazing, but at a much higher level. However its the one book that REALLY nails this stuff.

Comments