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.
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
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:
  - How the instruction set affects the performance
 
  - How to instrument the simulator to measure it
 
  - How a compiler generates codes for a processor
 
  - What operating system functions affect an instruction set
 
  - How to support special functions through the design of
instructions
 
Topic by Week
  - Overview of building a computer system
   
  - Nut language and semantic, its
internal structure, n-code       example of internal form
   
  - Semantic of n-code    
     the
evaluator   sim.txt 
(use with nut3.1)
   
  - Nut compiler    
    Nut-compiler completion kit    
    Nut-completion kit source 
 
  - Code generator    example:  gen.txt    
    How to do Code-gen completion kit
    (gen2.txt) the source
   
  - Computer Architecture     
    Microprogramming
   
  - Processor  Sx-chip   
    Sx-microprogram    
    How to microprogram Sx chip   
    mspec.txt
   
  - OS basics
   
  - Nut Operating System (NOS)   nos0.txt  (source code of NOS version
0)   
   
  - Supervisor program (NOSS)    package     the update code generator to handle (run (fn...))
 
  - Performance measurement
 
  - Code optimisation
 
  - Running an OS on a processor simulator
 
  - 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
  - Chongstitvatana, P., Essence of Computer System Engineering, in
print, 2006.
 
Computer languages
  - Horowitz, E., Programming languages: a grand tour, Computer
Science Press, 1983. 
   
  - Sebesta, R. Concepts of programming languages, 6th ed. Pearson/
Addison-Wesley, 2004.
 
  - Louden, K., Compiler Construction: Principles and Practice, PWS
Pub., 1997.
 
Computer architecture
  - Katz, R., Contemporary Logic Design, Addison-Wesley Pub Co., 1993.
 
  - Hennessy, J., and Patterson, D., Computer Architecture: a
quantitative approach, 3rd ed.  Morgan Kaufmann, 2003.
 
  - Patterson, D., and Hennessy, J., Computer Organization and
Design: the hardware/software interface, 2nd ed. Morgan Kaufmann, 1998.
 
Operating systems
  - Hansen, P. (ed.), Classic Operating Systems, Springer-Verlag,
2001.
 
  - Tanenbaum, A., Modern Operating Systems, Prentice Hall, 2001.
 
  - Silberschatz, A., Galvin, P., Gagne, G., Operating System
Concepts, 6th ed. John Wiley, 2003.
    
   
  - Additional materials will be hand-out as needed.
 
  - Reading:  Soul of a new machine, Tracy Kidder. 1981  (visit at
Wikipedia)
 
last update 15 Oct 2007