Professional Documents
Culture Documents
Lecture#3
Clock
Clock cycle = Clock period = 1 / Clock rate
CLK
Address
ADDR
RD
Data
DATA
Machine languages
In the earliest days of computers, the only programming
languages available were machine languages. Each
computer had its own machine language, which was
made of streams of 0s and 1s.
The only language understood by a computer is machine
language. (i.e. it’s native to processor)
Impossible for humans to read. Consists of only 0’s and
1’s.
0001001111110000
Reading Machine Language
First nine bits specifies the operation, last 6 (or 7) bits
specifies the arguments:
For example:
Instead of load instruction we might say 0004; thus
load 001000110001 is equal to 0004001000110001
Add might equal to 2005
Advantages Of Assembly Language
Faster as compared to programs written using high-level
languages
Efficient memory usage
…
add r1,r2
PC sub r2,r3
ALU Memory
cmp r3,r4 Registers
sub r4,1
…
Instruction Format
General Format of Instructions
Opcode Operands
What to do with the Where to get data and
data put the results
(ALU operation)
High-level languages
A high-level language is an advanced computer
programming language that isn't limited by the
computer, designed for a specific job, and is
easier to understand. Today, there are dozens of
high-level languages
Examples:
BASIC, C, FORTRAN JAVA and PASCAL
Advantages of High-Level Languages
Program development is faster
Program maintenance is easier