Ict114 Lecture 2
Ict114 Lecture 2
Objectives:
• Describe the general capabilities of a computer
• Processing – done by a processor • A processor is a device that can perform the following functions:
- Performs computations - Computation (+, ‒, ×, ÷)
- Performs “logic” functions such as comparison and branching - Comparison (<, =, >, ≠, ≤, ≥)
- Data movement among memory, mass storage, and I/O devices
• Storage – able to store instructions and data
• An instruction is a command to a processor to perform a specific
• Communication – within itself and with other devices function (e.g., addition) on specific data input(s)
Systems Architecture and Data Representation Systems Architecture and Data Representation
2-3 2-4
Systems Architecture and Data Representation Systems Architecture and Data Representation
2-5 2-6
Input/Output Capability Computer Hardware
Systems Architecture and Data Representation Systems Architecture and Data Representation
2-7 2-8
• Arithmetic-logic unit (ALU) • Secondary storage is one or more storage areas that:
– Performs computation and – Hold large quantities of data and programs
logic instructions – Is non-volatile (holds content indefinitely)
• Registers – Is much cheaper per bit than primary storage
– Internal storage locations – – Is much slower than primary storage
each holds one data item
– Hold inputs to and outputs • Secondary storage devices include:
from the ALU – Magnetic disk
• Control unit – Optical disk
– Moves data among registers – Flash RAM (and solid-state drives)
and other computer system – Magnetic tape
storage locations
– Accesses program instructions
and either executes them
(data movement) or directs the Figure 2.8 Components of the CPU
ALU to execute them Courtesy of Course Technology/Cengage Learning
(computation and logic
instructions)
Systems Architecture and Data Representation Systems Architecture and Data Representation
2-11 2-12
Storage Comparison Summary System Bus
Systems Architecture and Data Representation Systems Architecture and Data Representation
2-15 2-16
Objectives:
Systems Architecture and Data Representation Systems Architecture and Data Representation
2-19 2-20
– Execution cycle:
• Data movement instructions are executed by the control unit itself
• Computation and comparison instructions are executed by the ALU in
response to a signal from the control unit. Data inputs flow from
registers through processing circuitry and the output(s) flows to one
or more registers
Systems Architecture and Data Representation Systems Architecture and Data Representation
2-21 2-22
program
counter
• As stored in memory or a register, an instruction is a sequence of bits that
must be decoded to extract the processing function and data inputs (or the
location of the data inputs
• Instruction components:
Increment
program – Op code - a unique binary number representing the processing function
counter
and a template for extracting the operands
– Operands – one or more groups of bits after the op code that contain
data to be processed or identify the location of that data (a register or
memory address)
Figure 4.3 Control and data flow during the fetch and execution cycles
Courtesy of Course Technology/Cengage Learning
Systems Architecture and Data Representation Systems Architecture and Data Representation
2-23 2-24
Instruction Format (2) Clock Rate
• The system clock is a digital circuit that generates timing pulses, and
• Different kinds of operands have different lengths depending on the type of transmits the pulses to other devices in the computer
data or address stored therein
• It is generally a separate device with a dedicated communication line
monitored by all devices in the computer system
• The same processing function may correspond to many different op-codes • All actions, especially the CPU’s fetch and execute cycles, are timed according
with different operand formats (e.g., an ADD instruction for integers stored to this clock.
as operands, another for integers stored in registers, and another for integers
• Storage and I/O devices are timed by the clock signal
stored in memory)
• All devices in a computer system coordinate their activities with the system
clock
• The system clock generates “ticks” at regular intervals:
– Each tick of the clock begins a new clock cycle
– The CPU clock rate is the frequency of those ticks
– Typically stated in gigahertz (GHz) – billions of cycles (ticks) per second
– The inverse of the clock rate is the CPU cycle time
– Cycle time is the time required to fetch and execute the simplest
instruction in the instruction set (e.g., NOT)
FIGURE 4.4 An instruction containing one op code and two operands 1
Courtesy of Course Technology/Cengage Learning 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 =
𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
Systems Architecture and Data Representation Systems Architecture and Data Representation
2-25 2-26
Systems Architecture and Data Representation Systems Architecture and Data Representation
2-27 2-28
• A word is: • As fabrication technology has improved, CPU designers have been able
– A fixed number of bits/bytes to employ ever more complex performance improvement techniques
– The basic “unit” of data transformation in a CPU individually and in combination, including:
– The size of a data item that the CPU manipulates when executing a
“normal” instruction – Memory caching (Seminar 5)
– The size of a memory address? – Pipelining
– Multiprocessing
• The term has fallen into disuse as ever more complex CPU designs employ – Branch prediction and speculative execution
multiple word sizes
– For example, a 64-bit Intel Core CPU has word sizes ranging from 16 to
128 bits
Systems Architecture and Data Representation Systems Architecture and Data Representation
2-29 2-30
Pipelining – Technique to Speed Up Computer (1) Pipelining – Technique to Speed Up Computer (2)
Without pipelining: 1 instruction takes 6 CPU cycles => 10 instructions take 60 CPU cycles
• Pipelining is a Henry Ford era technique (i.e., the sequential assembly line) With pipelining: 1 instruction takes 6 CPU cycles => 10 instructions take 15 CPU cycles
applied to executing program instructions
• Execution stages:
1. Fetch from memory
2. Increment and store program counter (PC)
3. Decode instruction and store operands and instruction pointer
4. Access ALU inputs
5. Execute instruction within the ALU
6. Store ALU output
• Pipelining attempts to overlap instruction execution by performing each stage
on a different instruction at the same time
Systems Architecture and Data Representation Systems Architecture and Data Representation
2-33 2-34
Branch Prediction and Speculative Execution Branch Prediction and Speculative Execution
• Preventive Measures:
• Branches cause problems with pipelining because they invalidate the partially – Look-ahead – “watch” incoming instructions for branches and alter
executed instructions that follow them: standard behavior accordingly
– The wrong instructions (after the branch) were fetched and partially – Branch prediction – the CPU guesses whether a branch condition will be
executed true or false based on past experience
– Special- and general-purpose register contents are incorrect • If the guesses are right most of the time, the processor can prefetch the
correct instructions and buffer them so that the processor is kept busy
• The pipeline must be flushed and filling it with the proper set of instructions – Speculative execution
(the branch target) must being anew • As the CPU executes conditional BRANCH instructions, it keeps score how
often the condition for each branch instruction has been true or false
• Real programs have lots of branches • Based on the scores, the CPU speculatively execute instructions ahead of
– Thus, pipelining will often “fail” unless preventive measures are employed their actual appearance in the execution, holding the results in
temporary locations
• This enables the processor to keep its execution engines as busy as
possible by executing instructions that are likely to be needed
– Speculatively execute both paths beyond a conditional branch
• Requires multiple execution units
• Half the results will be thrown away (half the effort is wasted)
• Modern CPUs employ all three techniques to improve pipelining performance
Systems Architecture and Data Representation Systems Architecture and Data Representation
2-35 2-36
Summary on Processor Technology
• CPU operation
• Clock rate