0% found this document useful (0 votes)
17 views

Lecture 1

Uploaded by

princecboy001
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Lecture 1

Uploaded by

princecboy001
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Computer Architecture(CTE214)

by
Engr. B.S. Muhammad(BEng. BUK, MSc. ABU)

Department of Computer Engineering, Kaduna Polytechnic


Lecture One
Concept Of Computer Architecture
Introduction
Computer System
Figure 1-1 is an abstract graphical representation of what a computer
does. In a nutshell, a computer takes a stream of instructions (code)
and a stream of data as input, and it produces a stream of results as
output.
To illustrate this point, imagine that
one of those little black boxes in the
code stream is an addition operator
and that two of the white data boxes
contain two integers to be added
together, as shown in Figure 1-2.

Department of Computer Engineering


Introduction
Computer Architecture
is the design of computer systems, including all of their major subsystems
namely; the CPU, the memory and I/O systems. All of these parts play a major
role in the operation and performance of the overall system

CPU design starts with the design of the instruction set that the processor will
execute and includes the design of the arithmetic and logic hardware that performs
computations, the register set that holds operands for computations, the control
unit that carries out the execution of instructions, and the internal buses, or
connections, that allow these components to communicate with each other.

Memory system design uses a variety of components with differing


characteristics to form an overall system (including main, or primary, memory
and secondary memory) that is affordable while having sufficient storage
capacity for the intended application and being fast enough to keep up with the
CPU’s demand for instructions and data.

Department of Computer Engineering


Introduction
I/O system design is concerned with getting programs and data into the
memory (and ultimately the CPU) and communicating the computational
results to the user (or another computing system) as quickly and efficiently as
possible. None of these subsystems of a modern computer is designed in a
vacuum; each of them affects, and is affected by the characteristics of the
others.

Some examples of I/O devices are the computer keyboard, mouse, disk storage,
and graphical video displays. Other common I/O devices include network
interfaces, Wi-Fi and Bluetooth wireless interfaces, sound output to speakers,
and microphone input.

Department of Computer Engineering


Introduction
Types of computer systems
Many types of systems have been developed over the 60-plus year history of
modern computing machines. Computers can be categories based on size, speed
or application.
As an alternative to such classification it can be more generally be categorize
based on its architectural design. The most fundamental distinction is between
systems that have only one central processing unit and those that use multiple
(or parallel ) processors.

Single processor systems


Most general-purpose computer systems, even today, run programs on a single
CPU. Although many enhancements have been made over the years to the
original idea, almost every processor available today is descended from — and
owes much of its architecture to — the original von Neumann architecture
developed for the EDVAC and EDSAC back in the 1940s.

Department of Computer Engineering


Introduction
The von Neumann architecture, also known as the Princeton architecture
named after John von Neumann of Princeton University’s Institute for Advanced
Studies. The block diagram of the von Neumann computer shown in Figure 2
clearly shows input and output devices as well as the single memory used to store
both data and program instructions. The control unit and arithmetic/logic unit
(ALU) of the von Neumann machine are key parts of the CPU in modern
microprocessors.
The goal of the original von Neumann
machine was to numerically solve
scientific and engineering problems
involving differential equations, but it
has proven remarkably adaptable to
many other classes of problems from
weather prediction to word processing.
It is so versatile that the vast majority of
computer systems today are quite
similar, although much faster.
Figure 2 Architecture of the von Neumann computer.
Department of Computer Engineering
Introduction
The Harvard architecture is an alternative computer organization developed
by Howard Aiken at Harvard University and used in the Mark-I and Mark-II
machines. It aims to avoid the “von Neumann bottleneck” (the single path to
memory for accessing both instructions and data) by providing separate
memories and buses for instructions and data; thus, instructions may be fetched
while data are being read or written.

Figure 3 Harvard architecture vs. Princeton architecture.


Department of Computer Engineering
CPU DESIGN
CPU

At the heart of the modern computer is the microprocessor—


also commonly called the central processing unit (CPU)—a
tiny, square sliver of silicon that’s etched with a microscopic
network of gates and channels through which electricity flows.

The primary function of the CPU is to execute a set of


instructions stored in the computer’s memory. A simple CPU
consists of a set of registers, an arithmetic logic unit (ALU), a
control unit (CU), and CPU interconnections (BUS).

Department of Computer Engineering


CPU
Fig.4 shows the main components of the CPU and its interactions with the
memory system and the input/ output devices.

Fig.4 Central processing unit main components and interactions with the memory and I/O

The CPU fetches instructions from memory, reads and writes data from and to
memory, and transfers data from and to input/output devices.
Department of Computer Engineering
CPU

Arithmetic logic unit (ALU)


Similarly, to say that a computer “modifies” numbers implies that the computer
contains a device for performing operations on numbers. This device is the
ALU, and it’s the part of the computer that performs arithmetic operations
(addition, subtraction, and so on), on numbers from the storage area.

First, numbers are read from storage into the ALU’s data input port. Once inside
the ALU, they’re modified by means of an arithmetic calculation, and then
they’re written back to storage via the ALU’s output port.

In order to move data/instruction between the ALU and storage, some means of
transmission is required. Thus, the ALU reads from and writes to the data
storage area by means of the data bus, which is a network of transmission lines
for shuttling numbers around inside the computer. While the Instructions travel
into the ALU via the instruction bus.

Department of Computer Engineering


CPU
The code stream flows into the ALU in the form
of a sequence of arithmetic instructions. The
operands for these instructions make up the data
stream, which flows over the data bus from the
storage area into the ALU. As the ALU carries out
operations on the incoming operands, the results
stream flows out of the ALU and back to storage
area via the data bus. This process continues until
the code stream stops coming into the ALU.

Department of Computer Engineering


CPU
Let’s take a closer look at the relationship between the code, data,
and results streams by means of a quick example. In this example,
the code stream consists of a single instruction, an add, which tells
the ALU to add two numbers together. The ALU goes through the
following sequence of steps:
1. Obtain the two numbers to be added (the input operands) from data storage.
2. Add the numbers.
3. Place the results back into data storage.

The preceding example probably sounds simple, but it conveys the basic
manner in which computers operate. Computers are fed a sequence of
instructions one by one, and in order to execute them, the computer must first
obtain the necessary data, then perform the calculation specified by the
instruction, and finally write the result out. Those three steps are carried out
billions of times per second on a modern CPU, again and again and again.
It’s only because the computer executes these steps so rapidly that it’s able to
present the illusion that something complex is going on.

Department of Computer Engineering


CPU
Since numbers must first be fetched from storage before they can be
added, we want our data storage space to be as fast as possible so
that the operation can be carried out quickly. Since the ALU is the
part of the processor that does the actual addition, we’d like to place
the data storage as close as possible to the ALU so it can read the
operands almost instantaneously.

However, practical considerations, such as a CPU’s limited surface


area, constrain the size of the storage area that we can stick next to
the ALU. This means that in real life, most computers have a
relatively small number of very fast data storage locations attached
to the ALU. These storage locations are called registers. These
registers, which are arrayed in a storage structure called a register
file, store only a small subset of the data that the code stream needs.

Department of Computer Engineering


CPU
Building on our previous, three-step description of what goes on
when a computer’s ALU is commanded to add two numbers, we
can modify it as follows.
To execute an add instruction, the ALU must perform these steps:
1. Obtain the two numbers to be added (the input operands) from two
source registers.
2. Add the numbers.
3. Place the results back in a destination register

Upon receiving an instruction commanding it to perform this addition


operation, the ALU in our simple computer would carry out the following three
familiar steps:

Department of Computer Engineering


CPU
Obviously, four (or even eight) registers aren’t even close to the
theoretically infinite storage space required. In order to make a
viable computer that does useful work, you need to be able to store
very large data sets. This is where the computer’s main memory
comes in.
Main memory, is some type of
random access memory
(RAM) that stores the data set
on which the computer
operates, and only a small
portion of that data set at a
time is moved to the registers
for easy access from the ALU
(as shown in Figure 1-4).

Department of Computer Engineering


CPU
Figure 1-4 gives only the slightest indication of it, but main
memory is situated quite a bit farther away from the ALU than are
the registers. In fact, the ALU and the registers are internal parts of
the microprocessor, but main memory is a completely separate
component of the computer system that is connected to the
processor via the memory bus.
Transferring data between main However, because the registers
memory and the registers via the enable the computer to store
memory bus takes a significant data near the ALU, where it can
amount of time. Thus, if there be accessed nearly
were no registers and the ALU instantaneously, the computer’s
had to read data directly from computational speed is
main memory for each decoupled somewhat from the
calculation, computers would run speed of main memory.
very slowly.
Department of Computer Engineering
CPU
Control unit
The Control unit is the entity responsible for fetching the instruction to be
executed from the main memory and decoding and then executing it. Its
function is to interpret processor instructions and manage the execution of those
instructions by interacting with the other functional units within the processor
and with external components, including memory and input/output devices. The
control unit is a key part of the von Neumann architecture.

Register Set
Registers are essentially extremely fast memory locations within the CPU that
are used to create and store the results of CPU operations and other
calculations. Different computers have different register sets. They differ in the
number of registers, register types, and the length of each register.

Department of Computer Engineering


CPU
Some of the registers of a typical CPU are:

 Memory Access Registers


It is used to access data and instructions from memory during the execution
phase of instruction. Two registers are essential in memory read and write
operations:
1. The memory data register (MDR): also known as Memory Buffer Register
is the register in CPU that stores the data being transferred to and from the
immediate access storage
2. Memory address register (MAR): holds the memory location of data that
needs to be accessed

The MDR and MAR are used exclusively by the CPU and are not directly
accessible to programmers.
In order to perform a write operation into a specified memory location, the
MDR and MAR are used as follows:

Department of Computer Engineering


CPU
1. The word to be stored into the memory location is first loaded by the CPU into
MDR.
2. The address of the location into which the word is to be stored is loaded by the
CPU into a MAR.
3. A write signal is issued by the CPU.

Similarly, to perform a memory read operation, the MDR and MAR are used
as follows:
1. The address of the location from which the word is to be read is loaded into the
MAR.
2. A read signal is issued by the CPU.
3. The required word will be loaded by the memory into the MDR ready for use by
the CPU.
 Instruction Fetching Registers
Two main registers are involved in fetching an instruction for execution:
1. the program counter (PC) and
2. the instruction register (IR).

Department of Computer Engineering


CPU

The PC is a central component of the control unit. The PC register contains


the memory address of the next instruction to be executed.

When a computer system is powered on, the processor undergoes a reset


process to initialize its internal components to defined values. During the
reset process, it loads the Program Counter (PC) register with the memory
location of the first instruction to be executed. At the beginning of the
instruction execution cycle, the control unit reads the data word at the
memory address indicated by the PC and loads it into the IR for execution.
The fetched instruction is then loaded in the Instruction Register (IR) for
execution.

The IR is the register that holds the instruction currently being executed or
decoded. In a simple processors, each instruction to be executed is loaded
into the instruction register, which holds it while it is decoded, prepared and
ultimately executed

Department of Computer Engineering


CPU
As the control unit completes the reset process and begins executing instructions,
it performs the repetitive cycle shown below.

Instruction execution cycle

Department of Computer Engineering


CPU
Once the reset has completed, the PC register contains the initial instruction
location. The control unit fetches the first instruction from memory and
decodes it. Decoding is the process the control unit performs to determine the
actions required by the instruction.

Department of Computer Engineering


CPU
Bus

Data is transmitted from one part of a computer to another, connecting all major
internal components to the CPU and memory, by the means of Buses.

Control bus is part of the system bus, used by CPUs for communicating with other
devices within the computer.
Address bus carries the information about the device with which the CPU is
communicating, and
Data bus carries the actual data being processed.

Department of Computer Engineering

You might also like