Go
back to COSI 118- COURSE OUTLINE
The Central Processing Unit
-
The central processing unit (CPU) is
a highly complex, extensive set of electronic
circuitry.
-
The CPU consists of two parts: the control unit and the arithmetic/logic
unit.
The Control Unit
-
The control unit directs the entire
computer system to carry out stored program instructions.
-
The control unit communicate with both the arithmetic/logic unit and memory.
The Arithmetic/Logic Unit
-
The arithmetic/logic
unit (ALU) executes arithmetic
operations, including addition, subtraction, multiplication, and division.
It executes logical operations by comparing numbers, letters, and special
characters.
-
Logical operations test for three conditions:
equal to conditions in which two values are the same;
less than conditions in which one value is smaller than another;
greater than conditions in which one value is larger than another.
-
Relational operators (=, <, >) are used to describe the comparison
operations used by the ALU.
Registers: Temporary Storage Areas
-
Registers are temporary storage areas used by the CPU for instructions
or data.
-
There are a number of different registers with different jobs, including:
accumulator is a register that collects the results of computations;
address register keeps track of where a given instruction or
piece of data is stored in memory;
storage register temporarily holds data taken from or about
to be sent to memory;
general-purpose register is used for several functions, such
as arithmetic operations.
Memory
-
Memory is the part of the computer that holds data and instructions
for processing. Although closely associated with the CPU, it is separate
from it. Memory allows the CPU very fast access to instructions and data.
-
Memory associated with the CPU is also called primary storage, primary
memory, main storage, internal storage, and main memory.
This type of memory stores items only while the computer is turned on.
How the CPU Executes Program Instructions Click
here to see the steps.
-
Many types of personal computers can execute instructions in less than
one millionth of a second; super computers can execute instructions in
less than one trillionth of a second.
-
The CPU performs four steps in executing
an instruction:
-
The control unit gets the instruction from
memory.
-
The control unit decides what the instruction
means and directs the necessary data to be moved from memory to
the arithmetic/logic unit.
-
The arithmetic/logic unit performs the
actual operation on the data.
-
The result of the operation is stored in
memory or a register.
The first two instructions make up what is called the instruction time,
or I-time.
The last two instructions make up what is called the execution time,
or E-time.
-
The combination of the I-time and E-time is called a machine cycle.
-
Each central processing unit has an internal clock, which produces
pulses at a fixed rate to synchronize all computer operations. A
single machine cycle instruction is made up of a number of sub instructions,
each of which must take at least one clock cycle.
-
Each type of central processing unit is designed to understand a specific
group of instructions called the instruction set. Therefore
one CPU - say, for an IBM PS/2 - cannot understand the instruction set
from another CPU - say, for a Macintosh.
See figure 2 on page 86 and figure 3 on page 88.
Storage Locations and Addresses: How the Control Unit Finds
Instructions and Data
-
The location in memory for each instruction and each piece of data is identified
by an address, or a number that stands for a location in computer
memory.
-
An address may be compared to a mailbox in everyday life, except that the
address can hold only one item - a fixed amount of data, a number, or a
word - at any one time.
-
Programmers using programming languages do not have to worry about the
actual address number, since each address is a symbolic address, using
a name to identify its location.
See figure 4 on page 89
Data Representation: On/Off
-
A computer basically knows only two things: on and off. This on/off,
yes/no two state system is called a binary system.
-
The binary system has a base of 2. This means it contains only two
digits, 0 and 1, which correspond to the two states off and on.
Bits, Bytes, and Words
-
Each 0 or 1 in the binary system is called a bit
(for binary digit).
-
The bit is the basic unit for storing data in computer memory (0 means
off, 1 means on). Since a bit is always either on or off, the computer
is always storing some kind of data.
-
Single bits cannot store all the numbers, letters, and special characters
(such as $ and ?) that must be processed by a computer. The bits
are put together in a group called a byte
(pronounced "bite").
-
A byte usually holds 8 bits and represents one entity, like a character
of data such as a letter, digit, or special character.
-
Bytes are usually expressed by the thousands, millions, and billions: kilobytes
(KB or K), megabytes (MB), and gigabytes
(GB), respectively. A kilobyte is 1,024
bytes (210). A megabyte is 1,024,000 bytes (220) or 1,024 KB.
A gigabyte can be 1,024,000,000 bytes (230), 1,024,000 KB, or 1,024 MB.
-
Personal computer memory may have 64 MB and more.
-
A computer word is defined as the number of bits that constitute a common
unit of data, as defined by the computer system. The size is from
8 bits to 32 or 64 bits. The larger the word, the more powerful the
computer.
-
The parts of a computer are connected by collections of wires called buses
or bus lines. Each has a certain number
of data paths along which bits can travel; the number of data paths is
usually related to the number of bits in the word size.
Converting Decimal to Binary
Coding Schemes
-
We used coding schemes to define which particular set of bits is equivalent
to which character of data.
-
ASCII (pronounced "AS-Key") stands for American Standard Code for Information
Interchange. ASCII uses 7 bits for each character.
-
ASCII-8, also called extended ASCII, which uses 8 bits per character and
can represent 256 different characters.
See figure 6 on page 90.
Inside Your Personal Computer (We
will watch a video tape for it)
-
Basically there are two kinds of chips: one kind holds the central processing
unit, and one kind holds memory. A chip that holds the central processing
unit, or processor, is called a microprocessor. It may be
called a logic chip when it is used control specialized devices
(such as a watch or fuel system in a car).
Microprocessor: Computer on a Chip
-
Microprocessors usually contain four key components: the control unit and
arithmetic/logic unit, registers, buses, and a clock. (On personal computers,
the clock is usually on a separate chip.)
-
Microprocessors contain tiny transistors, electronic switches that may
or may not allow current to pass through. If current passes through,
the switch is on, representing the 1 bit. Otherwise, it is off, and
0 bit.
Memory Components
-
Historically, memory components evolved from vacuum tubes to magnetic cores
to semiconductors.
-
Most modern computers use semiconductor storage because it has several
advantages:
-
reliability
-
compactness
-
speed
-
low cost
-
low power usage
-
Semiconductor storage has one major disadvantage:
It is volatile, meaning it requires continuous electrical current
to work. If the current is interrupted, the data is lost.
-
There are two basic types of memory chips: RAM and ROM
-
RAM stands for
random-access memory.
It is usually volatile.
-
SRAM (pronounced "s-ram") - static RAM. It will retain its
contents without intervention from the CPU. It is faster than DRAM.
-
DRAM (pronounced "d-ram") - dynamic RAM. It is used in most
PC memory because of its size and cost advantages.
-
ROM stands for
read-only memory.
This one is still a random-access storage. However, data and programs
on ROM are printed at factory and cannot be changed. It is nonvolatile.
(i.e. When power is off, the information is still on ROM)
-
ROM burners can change the data and instructions in PROM
(programmable read-only memory chips.
Factors of making one computer faster than the others:
-
Microprocessor speed
-
The execution of an instruction on a very slow computer may take less than
a millisecond, one thousandth of
a second.
-
Most computers can execute an instruction in one millionth of a second,
a microsecond.
-
Some modern computers have reached the nanosecond
range- one billionth of a second.
-
Still to be broken is the picosecond
barrier - one trillionth of a second.
-
The speed of a computer system can be measured in many ways. Measuring
speed on personal computers is usually done in clock speed, expressed
in megahertz, representing one million
ticks per second.
-
Another measure of computer speed is MIPS,
which stands for one million instructions per second.
-
Bus line size
-
the available of cache
-
cache is pronounced "cash".
-
It is a selective memory. CPU gets data from it will be faster than
from main memory.
-
There are two kinds: internal cache (8KB) and external cache
(512KB).
Read page 96 for cache.
-
flash memory
-
nonvolatile
-
Flash chips are currently being used in cellular phones and cockpit flight
recorders, and they are replacing disks in some handheld computers.
-
RISC computers
-
Reduced instruction set computers
-
Parallel processing
-
It is using many processors, each with its own memory units, all working
at the same time.