Module Identifier COM3220  
Academic Year 2003/2004  
Co-ordinator Mr Christopher W Loftus  
Semester Available all semesters  
Pre-Requisite CO21120. Available only to students taking the Diploma/MSc in Computer Science scheme in Singapore.  
Course delivery Workload Breakdown   55 hours of contact time; lectures, practicals, workshops.  
  Workload Breakdown   145 hours of private study, practical work and assessment.  
Assessment TypeAssessment Length/DetailsProportion
Semester Exam2 Hours Written Exam  50%
Semester Assessment Assignment  50%
Supplementary Assessment Supplementary examination will take the same form, under the terms of the Department's policy  100%

Learning outcomes

On successful completion of this module students should be able to:
analyse a block diagram of a computer and explain how it works at the level of logic gates (A1);

analyse and develop low level programs and describe how they are executed by a CPU (A1, A2);

describe how a computer performs input and output operations (A1);

explain how abstract concepts in high-level languages, such as `function call' or `local variable', are implemented in machine code (A1);

judge the applicability of high and low level language programming (A1).

demonstrate a good understanding of the nature of the computer language "C" including the more challenging aspects of the language;

apply the facilities of the language "C" to technically advanced problems;

describe the differences between object oriented languages (such as Java) and non-OO languages (such as C) and make appropriate choices between such languages to solve a range of realistic problems;

Brief description

This module looks at the underlying hardware components used within a computer system and how they are linked. It goes on to cover the direct programming interaction with those components, through assembly language programming. The Linux operating system will be introduced and used for practical work. Students will learn to use the ANSI-C language in the Linux context.


Part A

1. What is a computer?

Block diagram overview; CPU, memory, I/O, Bus. Memory, Digital Logic; pigeon-hole model, address and contents, bits bytes and words.

2. Buses

Address, data and control buses. Basic data transfer.

3. Inside the CPU

Simple examples of instructions. The fetch-execute cycle and the program counter. Registers. ALU. Control unit. Implementing a machine code in hardware. Digital logic.

4. A real CPU example: Motorola 68000 and 68HC11 or Intel x86

Some machine codes and mnemonics. Addressing modes. Assembly code.

5. Executing high-level software

Machine-code equivalents of high-level constructs. Function calls. Stack frames and local variables.

6. I/O

Reading and writing data. Interrupts. Transferring large amounts of data; DMA, block I/O.

7. Exercises

Use a CPU simulator to watch instruction execution. Assembly language comprehension (probably, but not necessarily, by writing a program).

Part B

1. Introduction

Overall introduction to the module.

2. Unix at the command line

An introduction to the alternative Unix shells. Shell built-in commands and commonly used external commands and editors.

3. Shell Script programming

The programming language provided by a selected Unix shell in common usage.

4. Tools of the Unix Environment

Purpose and usage of Unix environment tools such as sed, sort, uniq, awk, grep and so on.

5. Basic Concepts of "C"

History of the C language, philosophical differences between C language design and Java. Basic form of a C program compared with that of a Java program. Using the compiler.

6. Control Structures Sequence, branching and iteration in C compared with that of Java.

7. Basic Data Structures

Review of basic data types and operators in C.

8. Functions

Discussion of ways in which functions are implemented, and used in C, including parameter passing mechanisms. Input/Output.

9. Composite Data Structures

A first discussion of Arrays in C.

10. Software Support Tools

Make, Lint, Debuggers. Libraries and library utilities.

11. C Programming Style and Portability

Language standards. Portability. Programming standards.

12. Arrays, Pointers and Functions

A discussion of pointer data types, how they relate to arrays, and how they contrast with references to Java objects.

13. Dynamic Data Structures

Implementation of various record structures and dynamic structures. Pointers. Malloc. Examples in C. Parallels will be drawn with how the internals of Java do this for you.

14. Pitfalls

Major problem areas. Design rationale of C and of Java in problem areas.

15. Further Features C preprocessor, header files, conditional inclusion, macro substitution, bitwise operators, casts, enumeration, scope, static and external declarations, separate compilation.

Reading Lists

** Recommended Text
Ronald J. Tocci and Frank J. Ambrosio. (2000) Microprocessors and Microcomputers: Hardware and software 5. Prentice Hall ISBN 0130104949
A. Kelley and I. Pohl. (1998) A Book on C: programming in C. 4. Addison-Wesley Pub Co ISBN 0201183994
** Consult For Futher Information
Ellen Siever (Editor), Jessica P. Hekman, Stephen Figgins and Stephen Spainhour. (2000) LINUX in A Nutshell: A Desktop Quick Reference. O'Reilly & Associates ISBN 0596000251


This module is at CQFW Level 7