C SC 100 Lecture Notes
Spring 2008
Pete Sanderson
[
previous
|
schedule
|
next
]
major resource: Tomorrow's Technology and You (Complete), Eighth Edition, Beekman and Quinn,
Pearson Prentice Hall, 2008
Chapter 2, Hardware Basics (core)
Stored Program Concept
Computers are classified generally into four categories:
- Supercomputers and mainframes
- PCs, Workstations and Servers (PCs and Workstations generally serve single user)
- Portable computers (notebook/laptop, PDA - Personal Digital Assistant)
- Embedded computers (special purpose, limited programmability, constitute over 90% of computers)
Although they differ in many respects (size, speed,
capacity, number of users, etc), nearly all are designed based on the
stored program concept.
Powerful concept that machine operation can be controlled by instructions stored in its memory and that the operation
can be changed by modifying the set of instructions rather than by modifying or rebuilding the machine itself.
- Jacquard loom, invented in 1801, used loop of punched cards to determine patterns woven onto the piece.
For different pattern, simply change and rearrange the cards.
- Babbage's Analytical Engine, designed starting in 1834 but never constructed, kept instructions in the "store" (memory) and used
those instructions to control computation in the "mill" (central processor)
- John von Neumann is generally recognized as the pioneer of the stored program concept, but was not its originator.
His post-ENIAC machine EDVAC was possibly the first to store both programs and data in the same memory.
- von Neumann's EDVAC design is now known as the von Neumann architecture, and is the basis for the
design of nearly all computers since. A simplified diagram is shown here.
Some core components
The core components of a von Neumann computer are:
- processor, or CPU
- primary memory
The input and output devices are considered peripheral and we will
study them separately.
Representing values and information
Computers represent numbers using a binary number system which uses two basic
values: 0 and 1. These correspond to a switch being either off (0) or on (1). This
simplicity is the key to the stability and reliability of computers.
To understand binary numbers, must understand radix notation.
- Radix notation: every column of a number represents a power of the base.
- In decimal, or base 10, there is a one's-place, a ten's-place, a hundred's-place,
etc.
- For example, 4379 = 4 * 1000 + 3 * 100 + 7 * 10 + 9.
- This is equivalent to 4379 = 4 * 103 + 3 * 102 + 7 *
101 + 9 * 100.
The binary number system also uses radix notation
- 2 is the base (it is also called base-2). use subscripts to identify the base
of a number
- For example, 11012 = 1 * 23 + 1 * 22 + 0 *
21 + 1 * 20
- In binary there is a one's-place, a two's-place, a four's-place, an eight's-place,
etc.
- The decimal equivalent of 11012 is 1 * 23 + 1 * 22
+ 0 * 21 + 1 * 20 = 8 + 4 + 1 = 1310
Counting in decimal and binary
The decimal number system has ten symbols (0, 1,
2, 3, 4, 5, 6, 7, 8, 9). To count you start, first, by listing all the symbols
in order, then adding a column and starting over in the first column. You continue
by incrementing a column every time you run out of symbols in the column to
its right. Counting in binary is exactly the same, only with fewer symbols.
| Decimal | Binary |
 |
 |
Storing things other than numbers
Computers store numbers in binary. Computers also store letters, other characters, computer programs, pictures and colors, and sounds in binary!
The most common standard for storing characters is ASCII
- American Standard Code for Information Interchange
- each character represented by unique 8 bit (1 byte) pattern
- there are 28, or 256, unique patterns
- see www.asciitable.com for an ASCII table.
- a new standard called Unicode uses two bytes
to represent a character, allowing for 65,536 unique patterns!
The web page http://www.immigration-usa.com/html_colors.html
has a chart showing the different colors and their numerical codes (given in hexadecimal, base 16) used by HTML,
the language for writing web pages.
We'll look in more detail how pictures are stored in the chapter on graphics.
Core Component: Processor
- This is the Central Processor Unit, or CPU
- the CPU has many components. A simplified list is (reference diagram)
- control unit (CU) : carries out the instruction
- arithmetic logic unit (ALU) : does arithmetic operations
- instruction decoding unit : decodes the instruction after it is read from memory
- prefetch unit : requests that instructions be read from memory
- bus interface unit : controls interactions with the memory unit (recall it is separate from CPU)
- these units must cooperate to make things happen
- The intricate dance they perform is known as the instruction cycle, which follows these major phases:
- Fetch the instruction : prefetch unit requests instruction from memory. It is transferred
from memory, via the bus, into the decoding unit.
- Decode the instruction : decoding unit decodes the operation and operands and activates the
control unit
- Execute the instruction : the control unit sends values to the ALU to
be added, subtracted, or whatever
- Store the results : the results of the operation may be stored into memory
- The instruction cycle is repeated millions of times per second.
- It is controlled by the computers clock, which sends out timing pulses, or "ticks".
- The instruction cycle requires several clock ticks. Some instructions require more clock ticks than others.
- CPUs are usually characterized by their clock speed, measured by number of clock ticks per second
- The usual units are "MHz" or "GHz"
- MHz means mega Hertz or 1 million clock ticks per second
- GHz means giga Hertz or 1 billion clock ticks per second
- NOTE: If you compare 2 computers with two different clock rates,
the one with the higher rate may not be "faster"!
- some instructions require more clock ticks than others
- if your software application uses lots of these complex instructions, it will run slower even on the same
computer than some other application
- Control Unit up close and personal
- major subcomponents are Instruction Register and Program Counter
- a register is a very small but fast storage (32 or 64 bits) located on the CPU
- the Instruction Register holds the next instruction to be carried out
- the Program Counter contains the memory address where the next instruction is stored
- Arithmetic Logic Unit up close and personal
- majors subcomponents are binary arithmetic circuits and accumulators
- the fundamental binary arithmetic operation is addition. Subtraction can be done by
negating then adding, multiplication by repeated addition, division by inverting then repeated addition
- the accumulators are registers which hold the arithmetic values and results
Core Component: Primary memory
- Where programs and data are stored for direct use by the processor. Can think of it as a large collection of
mailboxes. Each mailbox has a unique address plus its contents.
- When the processor needs an instruction or data
(the contents), it sends a request containing the address to the memory unit. The memory unit looks up that address
and responds with a copy of its contents.
- When the processor wants to store something in memory, it sends a request
containing both the address and the new contents to the memory unit. The memory unit finds that address and stores
the contents in it.
- Recall that everything is stored in binary. The size of each "mailbox" is based on the basic size unit,
the byte, or 8 bits.
- This is why many memory circuit boards contain 8 ICs or "chips". Each IC represents one position in the byte
- Primary memory is also known as RAM (Random Access Memory) or DRAM (Dynamic RAM). This means that any
address can be requested at any time.
- Memory is usually characterized by its capacity.
- The units used for primary memory are "KB", "MB" and "GB". Secondary memory also measured in "TB"
- KB means kilobytes or 1 thousand bytes (actually 1,024 which is 210)
- MB means megabytes or 1 million bytes (actually 1,048,576 which is 220)
- GB means gigabytes or 1 billion bytes (actually 1,073,741,824 which is 230)
- TB means terabytes or 1 trillion bytes (actually 240, which is somewhat higher)
[
Pete Sanderson
|
Math Sciences server
|
Math Sciences home page
|
Otterbein
]
Last updated:
Pete Sanderson (PSanderson@otterbein.edu)