Skip to content

Elements of Computing Systems Chapter 2

mocoso edited this page Nov 29, 2014 · 4 revisions

Notes from London Computation Club's second NAND2TETRIS meeting from Mon 24th Nov, covering chapter 2

Preamble

  • Decided not to review chap 1
  • Most had read chap 2
  • Half had completed/attempted the exercises

2’s Complement

  • Number line
  • Get from positive to negative by flipping all the bits and adding 1
  • Think about odometers
  • Easy to map positive to negative
  • Easy to add negative to positive
  • Almost all computers use it… which don’t?
  • How Ruby encodes negative integers

Half adder

  • Obfuscation of LSB/MSB
  • Seemed obvious enough from the truth table
  • Drew on the whiteboard

Full adder

  • Drew on the whiteboard
  • Start by half-adding a and b
  • Then half-add sum1 and c
  • We throw away the overflow, why is that okay?
  • Is there a way to do it without half-adders?
  • Worked through the canonical form HOMEWORK

Add16

  • Fundamentally about chaining the carry bit through
  • No overflow

ALU

  • Why is this interesting?
  • Provides a selection of useful functions and some other stuff we don’t care about
  • Do we need x+1 and x-1? Depends on the architecture?
  • Decompose the operations into crafty ways to perform the operations we’re after
  • Tried to reason through some of the operations
  • 2’s complement relied upon
  • Our completed ALU

Other Notes

  • Increase frequency of meetups?
  • 3 weeks for the next 2, then talk about it again
  • James’ rake command to avoid the GUI
  • Chris: look into other ideas of how to design an ALU
  • James’ real life version with Arduino
  • Could we buy these chips off the shelf and build the real thing?
Clone this wiki locally