Some resources for the course

Sample Midterm in Documents section of Blackboard

Text book web site

  • Main Page is here
  • Student Site is here. This site has Lots of very useful links, some replicated below.

    Logic Design Online Book

    Pragmatic Logic by William J. Eccles

    Logic Design Tool

    Logisim is a very nice tool that runs on any platform (MAC, Windows, Linux). You can use this to design and test circuits. Click through the download links until you arrive at the sourceforge.net site and then look for the green download button, click that it should autodetect your system so you get the right version.

    Unix & C

  • Prof Norm Matloff's Tutorials are here .

    Remote access to Linux machines

    To access a Linux machine at Duke using your NetID you will need to use ssh to remotely access a machine or you can go sit at one of the machines in the Teer building. The teer machines are numbered 10-45, so the names are teer10.oit.duke.edu, teer11.oit.duke.edu...teer45.oit.duke.edu Pick one at random to use.

    From a MAC

    On a MAC you can open a Terminal, which is Applications/Utilities that will give you a Unix command prompt. From this prompt you can simply type 'ssh <netID>@<hostname> to access a remote machine, for example I would type 'ssh alvy@teer21.oit.duke.edu' (without the ') to make a connection to teer21.oit.duke.edu. You will then be asked for your password.

    From Windows

    On Windows you need to install an additional program, we recommend PuTTY, see below for where to get PuTTy. This program allows you to open a remote connection using ssh.

    Tools used in this class

  • Remote connection: ssh
  • Text editor: vi or vim
  • Compiler: gcc
  • Debugger: gdb
  • C Code Examples

  • C Memory Layout Example array as list
  • C Bit Manipulation bit manipulation of Hex to extract float fields or for a float input with casting via pointers extract float fields from float input .

    Intel IA32 Instructions

  • A single sheet (two-sided) with common IA32 instructions is here.

    GNU Assembler Syntax

    A GNU manual on assembly programming is here.
  • Calling an Assembly Function from C
    	Put main in normal C file as before
    	Declare function using extern
    		E.g., extern int foo();
    		Foo is our assembly function in a .S file
    
    

    Assembly Programming Examples

  • sum = sum + i*i is here.
  • sum array is here.
  • procedure call from C to Assembly C source and Assembly source
  • recursive sum array is here.
  • recursive sum i*i is here. the C file for main is here.
  • Find node in linked list here.
  • How to debug assembly code: demo during recitation.

    Logisim

    8-bit Register File: cps104.jar

    Instruction memory initialization file: d_mem.hex

    8-bit ALU: ALU.circ

    Intel x86 Instruction Set & Assembly Programmers Manual

  • Full manual.
  • Volume 1: Basic Architecture.
  • Volume 2A: Instruction Set Reference, A-M
  • Volume 2B: Instruction Set Reference, N-Z
  • Volume 3A: System Programming Guide, Part 1
  • Volume 3B: System Programming Guide, Part 2