2110793 Advanced topic in digital systems   2007

Prabhas Chongstitvatana
email me
office:  Engineering building 4, floor 18, room 13,  phone 02-218-6982
lecture:    Mon  9:30-11am   Eng. Bld. 4,  floor 19   small lecture room
               Thurs  9:30-11am  Eng. Bld. 3, room 405.

Previous lecture  2004    2002     2001  1999

What's new

19 June 2007  The evaluator,   Nut compiler
28 June 2007   Nut compiler completion kit  Discussion on language extension
2 July 2007     Code generation
5 July 2007      Prefix object code format:  the writer
7 July 2007      Fix bug in nut31.zip package,  now it can compile and run nut-in-nut compiler to compile itself.  Please use the updated nut31.zip for your work.
5 Aug 2007     Sx chip  and tools   sx0.zip
14 Oct 2007    Chapter 8    Chapter 9   App I     App J   of my "essence" text book.  (online until  Sept 2007)
                       Final update software

Syllabus

Announcement

  28 June 2007     On the occassion of teacher's day ceremony, today's lecture will start at 10:30am.
  5 July 2007        There will be no class on Wed 12 July, due to Graduation Ceremony
  5 August 2007    The midterm question is posted.  Hand-in by next Tuesday 14 Aug. by 4pm.
14 October 2007     Final exam is out.  Due  before  Friday 26 October 2007, 4pm.

Aim

This serie of lectures aims to integrate the knowledge of building a computer system from the most bottom level: functional units, data path, microprogram, to the highest level: operating system, high level language and application programs.  An executable abstract language is used to as a mean to explore all levels. 

This course offers a "hand-on" approach.  Students go through series of building and modifying a "system" simulator.  The system simulation composed of: an instruction-level processor simulator, a compiler, a profiler, a real-time operating system includes task switcher and message passing.  Real-time concurrent application programs such as multiple clocks will be run on this operating system.
 
The students will learn:

Topic by Week

  1. Overview of building a computer system
  2. Nut language and semantic, its internal structure, n-code       example of internal form
  3. Semantic of n-code     the evaluator   sim.txt  (use with nut3.1)
  4. Nut compiler     Nut-compiler completion kit     Nut-completion kit source
  5. Code generator    example:  gen.txt     How to do Code-gen completion kit     (gen2.txt) the source
  6. Computer Architecture      Microprogramming
  7. Processor  Sx-chip    Sx-microprogram     How to microprogram Sx chip    mspec.txt
  8. OS basics
  9. Nut Operating System (NOS)   nos0.txt  (source code of NOS version 0)  
  10. Supervisor program (NOSS)    package     the update code generator to handle (run (fn...))
  11. Performance measurement
  12. Code optimisation
  13. Running an OS on a processor simulator
  14. Real-time OS

Assignments

Week 1

Write Nut program
1.1  To find maximum of three numbers.
1.2  To sum the odd numbers from 1..m.
1.3  To do multiplication from addition.
1.4  Use 1.3  to do x power to n.

Draw N-code from nut program
2.1  from the following program to do sum a..b

;; sum a..b using recursion with accumulating parameters

(def sum (a b s) ()
  (if (> a b) s
    (sum (+ a 1) b (+ s a))))

(def main () ()
  (sys 1 (sum 1 10 0)))

2.2  Write a small nut program and draw its n-code.

Week 3

Experimenting with the evaluator and understand some runtime idosyncracy.
3.1   Try out the evaluator, sim.txt   and find out where t2.obj is loaded to.
3.2   Change the meaning of instruction "add",   (+ a b ) to mean  a + b + 2.  Then try t2.obj to check the result.

Week  4

Working with compiler   For how-to discussion
4.1  Extend the nut-in-nut compiler to include "let" and "enum"
4.2  Write a function in nut compiler to output "linearise" vesion of object code, so that the object code will be locatable.  (example : the writer "code.txt")

Week 5

Code generator
5.1    Complete the code generator (using the code gen completion kit).  (gen2.txt)
5.2    Write some nut program and compile, generate s-code and run it using somv2.

Week 6

Write simple microprogram to create a new instruction for the example data path.

Week 7

Write microprogram to implement some instruction of Sx chip: increment and decrement local variables.

Week 8

Try NOS and change the delta parameter in the NOS supervisor.  Write some programs and run them concurrently.

Documents

Tools

Text

Computer languages
Computer architecture
Operating systems
last update 15 Oct 2007