Upgrade to Pro — share decks privately, control downloads, hide ads and more …

I wanted a computer, but all I got was a transi...

I wanted a computer, but all I got was a transistor

Denis Defreyne

September 08, 2015
Tweet

More Decks by Denis Defreyne

Other Decks in Programming

Transcript

  1. I wanted a computer, but all I got was a

    transistor. Denis Defreyne 1
  2. 2 I will explain how to build a computer from

    scratch. I cannot do this without taking some shortcuts. I will tell lies. CAUTION
  3. 3

  4. 8

  5. 9

  6. 10

  7. 11

  8. 13

  9. 14

  10. 15

  11. 16

  12. A B Sum 0 0 0 0 1 1 1

    0 1 1 1 0 20
  13. A B Carry 0 0 0 1 A B Sum

    Carry 0 0 0 0 1 1 1 0 1 1 1 0 21 AND XOR
  14. 27 ADD SUM 0 A 0 B 0 ADD SUM

    1 A 1 B 1 ADD SUM 0 A 0 B 0 ADD SUM 1 A 1 B 1 ADD A 2 B 2 SUM 2
  15. 31 ADD R A B MUL R A B DIV

    R A B MOD R A B
  16. A B S Result 15 7 0 (+) 22 15

    7 1 (*) 105 15 7 2 (/) 2 15 7 3 (%) 1 41
  17. 51 D-LATCH D 0 Q 0 D-LATCH D 1 Q

    1 D-LATCH D 2 Q 2 D-LATCH D 3 Q 3 D-LATCH D 4 Q 4 D-LATCH D 5 Q 5 D-LATCH D 6 Q 6 D-LATCH D 7 Q 7 E
  18. 68 0 3 0 2 Add register 0 and register

    2, and store result in register 3: OPCODE INPUT REG 1 OUTPUT REG INPUT REG 2
  19. 69 “add r3 r0 r2” Add register 0 and register

    2, and store result in register 3:
  20. 70 “add r3 r0 r2” 0 3 0 2 assembly

    language machine code assembler
  21. 16 0 0 12 127 56 16 1 0 3

    224 211 18 1 0 0 0 0 7 32 15 2 1 19 1 0 1 15 0 2 6 12 14 0 255 0 71
  22. li r0, 819000 li r1, 254163 cmpi r1, 0 jeq

    @end mov r2, r1 mod r1, r0, r1 mov r0, r2 jmp @start prn r0 halt 72
  23. 73 cmp mod add sub mul div xor or and

    shl shr not ARITHMETIC
  24. 74 j je jne jg jge jl jle cmp mod

    add sub mul div xor or and shl shr not lw lh lb sw sh sb STACK FUNC SPECIAL call ret push pop prn halt BRANCHING ARITHMETIC mov li MEMORY REG
  25. 77