Lec 2
Lec 2
Lec 2
System Design
Lecture-2
1
Objectives of the lecture
2
Computing System
3
CPU (Central
Processing Unit)
• It is a general-purpose
processor.
• It is a programmable digital
system intended to solve
computation tasks in a large
variety of applications.
4
Microprocessor
5
Evolution of
Microprocessors
• Transistor was invented in 1948 (Bell lab). IC was invented in 1958
(By Texas Instruments).
• The first microprocessor was invented by INTEL(INTegrated
ELectronics).
6
Name Year of Invention Inst. per sec
INTEL 4004/4040 (4
1971 60,000
bit)
AMD Ryzen
Threadripper 3990X 2020 2,356,230
7
M
(64 core)
Datapath
• It contains an arithmetic-logic unit (ALU) capable of
transforming data through arithmetic operations.
• It also contains registers capable of storing temporary data.
• The internal data bus is the bus over which data travels within
the datapath.
• The external data bus is the bus over which data is brought to
and from the data memory.
• We measure size of processor by bit-width of the datapath
components. Ex: 64-bit processors.
8
Controller/ Control Logic
• It consists of circuitry for retrieving program instructions, and for moving data through
the datapath according to those instructions. It contains :
• program counter (PC) that holds the address in memory of the next program
instruction to fetch.
• instruction register (IR) to hold the fetched instruction.
• Based on this instruction, the controller’s control logic generates the appropriate signals
to control the flow of data in the datapath.
• The address size determines the number of directly accessible memory locations,
referred to as the address space or memory space. Thus, a processor with a 16-bit
PC can directly address 216 = 65,536 memory locations. We would typically refer to
this address space as 64K
9
Memory
10
Two memory architectures: (a)
Harvard, (b) Princeton
11
Memory
• Read-only memory (ROM): Program memory
• Readable and writable memory (RAM): Data
Memory
12
13
Internal and External Memory
15
How does Cache Memory
works?
• Cache memory is based on the principle that if at a particular time a processor
accesses a particular memory location, then the processor will likely access that
location and immediate neighbours of the location in the near future.
• When we first access a location in memory, we copy that location and some
number of its neighbours (called a block) into cache, and then access the copy of
the location in cache.
• When we access another location, we first check a cache table to see if a copy of
the location resides in cache.
• Cache hit: If the copy does reside in cache, we can read or write that location
very quickly.
• Cache miss: If the copy does not reside in cache, we must copy the location’s
block into cache, which takes a lot of time. 16
(a) general-purpose, (b) application-specific,
(c) single-purpose processor.
17
Microcontroller
19
Instruction execution
• A microprocessor’s execution of instructions consists of several basic
stages:
1. Fetch instruction: the task of reading the next instruction from memory
into the instruction register.
2. Decode instruction: the task of determining what operation the
instruction in the instruction register represents (e.g., add, move, etc.).
3. Fetch operands: the task of moving the instruction’s operand data into
appropriate registers.
4. Execute operation: the task of feeding the appropriate registers through
the ALU and back into an appropriate register.
5. Store results: the task of writing a register into memory.
• If each stage takes one clock cycle, then we can see that a single
20
instruction may take several cycles to complete.
Flow of control logic in
instruction
• Ex: Adding two values.
1. Fetch instruction of adding,
2. decode it,
3. Inputting two values in particular registers,
4. send the values into the ALU, storing ALU results into a particular
register,
5. moving data between register and memory.
• Finally, the next-state logic determines the next value of the PC.
21