Computer Science 230H
Language of the Computer
Prepared by Michael Jack - Fall 2007
The information and figures for the following slides were prepared from the
– Patterson, D., and Hennessy J., Computer Organization and Design,
3rd edition, 2005
To command a computer’s hardware, you must speak its language.
The words of a computer language are called
, and its vocabulary
is called an
Computer languages are fairly similar – once you learn one, it is easy to pick
– All computers are constructed from hardware technologies based on similar
– There are a few basic operations that all computers must provide.
By learning how to represent instructions, you will also discover the secret of
the stored-program concept
– Stored-program concept is the idea that instructions and data of many types can
be stored in memory as numbers, leading to stored program computer.
The chosen instruction set comes from MIPS.
– MIPS microprocessors are found in products from ATI Technologies, Broadcom,
Cisco, NEC, Nintendo, Silicon Graphics, Sony, Texas Instruments, and Toshiba,
among many others.
Operations of the Computer Hardware
Every computer must be able to perform arithmetic.
The following MIPS assembly language notation instructs the computer to add the two
and to put their sum in
a, b, c
This notation is rigid in that MIPS arithmetic instruction:
Performs only one operation
Must always have exactly three operands
Operand order is fixed (destination first)
E.g. suppose we want to place the sum of variables
, into variable
The following sequence of instructions adds the four variables:
a, b, c
// The sum of b and c is placed in a.
a, a, d
// The sum of b, c, and d is now in a.
a, a, e
// The sum of b, c, d, and e is now in a.
It takes 3 instructions to take the sum of four variables.