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

Lecture1 All

computer organization

Uploaded by

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

Lecture1 All

computer organization

Uploaded by

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

CS 3101

Computer organization &


assembly language
Main points only
Why do we study computer organization?
•Understanding Structure and Interaction: It helps us learn how the different
components of a computer (like the CPU, memory, and I/O devices) are
structured and how they interact to perform tasks efficiently.

•Identifying and Fixing Bottlenecks: By studying computer organization, we


can focus on performance problems like slow memory access or slow data
transfers, and find ways to fix these issues and make the system run faster and
more efficiently.

•Writing Efficient Code: Understanding how hardware works allows software


developers to write more efficient code that takes full advantage of the
underlying system architecture.
Why do we study computer organization?

•Optimizing Hardware Solutions: Hardware engineers can use this knowledge


to design and develop more efficient hardware components, improving things
like power consumption, processing speed, and memory management.

•Troubleshooting: Knowledge of computer organization helps in diagnosing


and resolving hardware or software problems by understanding how different
components should work together.

•Foundation for Advanced Studies: It lays the groundwork for advanced areas
of computer science, such as operating systems, networks, embedded systems,
and computer architecture, which require a deep understanding of how
computers are built and operate.
TOPICS COVERED
• 1.1 What is computer architecture
and computer organization?

• 1.2 What is computer structure and
computer function?
Computer Architecture versus Computer organization
• Architecture:

– Attributes of a system that are visible to a programmer. The


features that a programmer interacts with directly, such as

• instruction set, data types, I/O mechanisms, and memory


addressing techniques

– These attributes define how the system can be


programmed and what kind of operations it can
perform. Not req.

– have a direct impact on the logical execution of a program.

• Ex: the instruction set determines the available commands that


a programmer can use, and the memory addressing technique
impacts how data is stored and accessed. Not req.
Computer Architecture versus Computer organization
• Organization:

- focuses on how operational units, such as the CPU, memory,


and input/output devices, interconnect and interact to
perform tasks based on the specifications/ features defined
by the architecture.

- It includes details about the hardware; control signals,


memory types, and device interfaces, which are usually
transparent to the programmer but essential for executing the
architecture's instructions efficiently.
-
Architecture
defines:

The following part is for reading only


• Instruction set architecture (ISA) is a key component of computer architecture.
• It defines the set of machine-level instructions that the CPU can execute.
These are the basic commands like:
•Arithmetic operations (e.g., ADD, SUBTRACT)
•Logical operations (e.g., AND, OR)
•Data movement instructions (e.g., LOAD, STORE)
•Control instructions (e.g., JUMP, CALL)
• These instructions are built into the hardware as part of the CPU's design and
dictate what kind of operations the computer can perform.

• When programmers write software, especially low-level software like assembly


language, they are directly using these built-in instructions.
Architecture
defines:

direct, indirect, or indexed addressing

The following part is for reading only


• I/O mechanisms: the methods and processes that the computer system uses
to manage input and output operations.

• emphasize how the computer's software sends and receives data


from external devices, ensuring efficient communication and
coordination during data transfer.

• Memory addressing techniques: define how the system locates, and accesses
data stored in memory.
Architecture
defines:

The following part is for reading only


Control Signals (generated by the CPU's control unit): manage and coordinate various
operations of a computer's hardware components. They ensure that the right operations are
performed at the right time, particularly in the following ways:
•Control signals manage instruction execution, ensuring that each instruction is processed
correctly and in sequence.
•They direct the flow of data within the CPU, memory, and I/O devices by determining
which data paths to activate during read and write operations, facilitating the movement
of data between different parts of the system.
•Control signals activate or deactivate specific parts of the CPU, such as the ALU for
arithmetic operations and registers for holding data, allowing these components to
function precisely when needed.
Architecture
defines:

The following part is for reading only


•Interfaces between computers and peripherals: physical connections and
communication protocols that govern/regulate the transfer of data between the computer
and external devices (printers, keyboards, and storage drives).

•Memory Technology Used: the type of memory:

•Main Memory (RAM): the system's short-term memory, where data and
programs currently in use are stored for quick access.

•Secondary Storage: Devices like hard drives (HDDs) and solid-state drives
(SSDs) are used for long-term data storage.

•SSDs, being faster, allow quicker access to data compared to HDDs.


Ex: At designing
Several issues (decisions) that are to be considered:

• Whether a computer will have a built-in multiply instruction.


– It is part of defining (ISA), which describes the functions
and capabilities that the processor will provide to software.
– This is an: Architectural design issue.

• Once the architecture defines that there will be a multiply


instruction, the organization design must decide how to
implement it in hardware.

• Whether that instruction will be implemented by a special


multiply unit (built into the hardware) or by a mechanism
that makes repeated use of the add unit of the system.
-This is an: Organizational issue.
Organizational decision
• Based on:
–Expected frequency of use of the
multiply instruction,
–Relative speed of the two approaches,
–Cost and physical size of a special
multiply unit.
TOPICS COVERED
• 1.1 What is computer architecture
and computer organization?
• 1.2 What is computer structure and
computer function?
Computer system

• Computer systems can be described as hierarchical system.


• A hierarchical system: is a set of interrelated subsystems
that are organized in levels.
• Designers need only deal with a particular level of the
system at a time.
Computer system

• At each level, the system consists of a set of


components (such as CPU, memory, or input/output
devices) and their interrelationships.

• At each level, the designer is concerned with structure


and function.
Computer Structure versus Computer function
• Structure:
– defines how the components are interrelated. This includes:
• physical connections (ex: buses): that link the CPU, memory,
storage, and I/O devices.
• logical relationships: how data flows between components such
as from memory to CPU or from storage to output devices.
• Function:
– The role or operation of each individual component as part of the
structure. Ex:
•CPU: Processes instructions and performs calculations.
•Memory: Stores data and instructions.
•I/O Devices: Handle data exchange with external systems.
Basic functions that a computer can
perform in which the computer
operates.
• Process data - It includes various
devices that can either
• Store data provide data (sources)
or receive data
• Move data between the system
(destinations).
itself (internal components;
- EX., a keyboard is a
CPU and memory) and outside source of input data,
while a monitor is a
world (any external devices or
destination for output
systems; keyboards, printers, or data.
Not req.
other computers).

• Control of these three functions

Figure 1.2: Functional view of computer.


Functional view of computer
• Data Processing:

o Despite the variety of data forms (numbers, text, images, videos)


and their respective processing requirements (ex: memory usage,
processing power), there are a limited number of core processing
types that can be performed on them:

- Arithmetic Operations: addition, subtraction, multiplication,


and division.

- Logical Operations: AND, OR, and NOT, which are used in


decision-making processes.

- Data Manipulation Operations: sorting, searching, filtering.


Functional view of computer
• Data Storage:

o Short-term Storage: Required for holding data temporarily during


processing.

o Long-term Storage: Involves saving files on the computer for future


retrieval and updates. Ex: storing documents or program files on hard
drives or SSDs.

• Moving data between itself and outside world:

o some input-output (I/O) operations are required to move data between


computer and peripherals.

- I/O operations include actions like: reading data from external


sources (when receiving input from a mouse) or sending data to
external destinations (when sending a print command to a printer).
Functional view of computer
• Control of these three functions; data processing, data storage,
and data movement.

o There is a control unit in computer to manages the


computer’s resources.
o It manages these three functions, ensuring they operate efficiently
and in coordination with each other.

o It provides signals and commands to the different components of


the computer (such as the arithmetic logic unit, memory, and
input/output systems) to perform specific tasks.
Basic structure
Internal structure of computer

Registers, ALU,…
Main

System RAM
interconnection

hard drives, SSDs

Figure 1.3: Essential components of computer.


Four main structural components
1. Central processing unit (CPU): often simply referred to as processor.

- Controls the operation of the computer (directs and manages all the tasks
and activities inside a computer) and

- performs the core data processing tasks, making it essential for executing
instructions and computations

2. Main memory: is the storage area where data and instructions are kept
temporarily while the CPU needs them for processing.

3. I/O: Moves data between the computer and its external environment.

4. System interconnection: Some mechanisms for communication (exchanging


data) among CPU, main memory, and I/O.

- A common Ex. of system interconnection: a system bus, consisting of


several conducting wires to which all the other components attach.
CPU main components
• Four major structural components:
1. Control unit: Controls the operation of the CPU and hence the computer.

2. Arithmetic and logic unit (ALU): Performs the computer’s data processing
functions.

– It performs calculations (like addition or subtraction) and logical operations


(like comparing values)

3. Registers: Provides storage internal to the CPU.

– They are small, very fast storage areas inside the CPU that temporarily hold
data and instructions that the CPU is currently using or processing.

4. CPU interconnection: Some mechanisms (often a system of buses and internal


circuits) that provide for communication among the control unit, ALU, and
registers.

– They enable data and control signals to flow between the Control Unit, ALU,
and registers, allowing these components to work together seamlessly.
Key concepts of design that most modern
computer follows
• Such a design is referred to as the: von Neumann architecture.
• Three key concepts:
1. Data and instructions are stored in a single read–write memory.

o Both the data the computer uses and the instructions for processing
that data are kept in the same type of memory that can be read
from and written to.

2. Contents of this memory are addressable by location, without


regard to the type of data contained there.

o Each piece of data and instruction in memory has a specific address, and
o you can access them based on these addresses, regardless of whether
they are numbers, text, or other types of information.
Key concepts of design that most modern
computer follows
3. Execution occurs in a sequential fashion (unless explicitly modified)
from one instruction to the next.

o Computer processes instructions one after the other in a specific


order,
o unless a special instruction tells it to jump to a different part of
the program.
von Neumann architecture

Key concepts of design

Allow the computer to communicate with


external hardware like keyboards, monitors stores data and instructions

This Figure
expands
Figure 1.3

Figure 1.4 illustrates the top-level components


of computer and suggests the interactions
among them.
Top-level components and interactions
• CPU deals (interacts) with two components: I/O and memory.

1. CPU exchanges (sends and receives) data with memory:

o For this, CPU makes use of two internal registers:

i. memory address register (MAR): temporarily holds the memory


address that will be accessed during the next read or write
operation.

- Ex: if the CPU needs to get data from memory address 0x10, it
will store that address in the MAR before accessing the data.

ii. memory buffer register (MBR): temporarily holds the data that
is either being written to memory by the CPU or data that has been
read from memory.
2. CPU exchanges data with I/O:

o CPU uses two internal registers:

i. I/O address register (I/O AR): holds the address or identifier


of a specific I/O device that the CPU wants to communicate
with.

ii. I/O buffer register (I/O BR): is used for exchanging data
between an I/O module and the CPU.

- It temporarily stores data being received from an I/O


device to the CPU, or it holds data that is being sent from
the CPU to the I/O device.
•Program Counter (PC): keeps track address of the next instruction that the
CPU will execute.
- After control unit fetch an instruction from memory, the PC is
incremented (usually by 1) to point to the address of the next
instruction that will be executed.
- ex: If the current instruction is at address n, after fetching it, the
PC will point to address n+1, preparing for the next instruction.

• Instruction Register (IR): stores the instruction that has been fetched
from memory and is currently being executed.

• Execution unit:

– Arithmetic Logic Unit (ALU): Handle basic arithmetic and logical


operations.
Top-level components and interactions
• Memory module: consists of a set of locations, defined by
sequentially numbered addresses.
- Each location contains a binary number that can be interpreted as either an
instruction or data.

• I/O module: transfers data from external devices to CPU and


memory, and vice versa.
- It contains internal buffers for temporarily holding these data until they
can be sent on.

• All these components are interconnected through the bus.


- A bus that connects major computer components (processor, memory, I/O) is
called a system bus.
Bus and its three groups
• Bus is a communication pathway connecting two or
more devices. Figure 1.5: Bus Interconnection Scheme

• Bus is a shared transmission medium.


• Means: all components (CPU, memory, and I/O devices) can communicate
over a shared bus.
• A signal transmitted by any one device is available for reception by all other
devices attached to the bus.
• Only one device at a time can successfully transmit.
• If two devices transmit during the same time, their signals will overlap
and become garbled.
• Bus consists of multiple communication pathways, or lines.

– Each line is capable of transmitting binary signals (either a


1 ("on" or "active“)( or 0 "off" or "inactive“)).
• The lines on any bus can be classified into three functional groups:

1. Data lines: (also called data bus) provide a path for moving data among
system modules.

• Data bus may consist of 32, 64, 128, or more separate lines.

• Number of lines in data bus (refers to its width): determines how


many bits can be transferred at a time, because each line can carry only
1 bit at a time.

o Data bus width is a key factor in determining overall system


performance.

o Ex, if the data bus is 32 bits wide and each instruction is 64 bits
long, then the processor must access the memory module twice
during each instruction cycle.
2. Address lines: (also called address bus) are used to specify:

memory location or I/O port (external devices) from which data is to be


read or to which data is to be written.

Ex, if the processor wishes to read a word (8, 16, or 32 bits) of data
from memory,

• it puts the address of the desired word on the address lines.

• This address specifies the exact location in memory where the data
is stored.

• Then, the data at that specified location is transferred over the data
bus to the processor.
• Address bus width determines how many unique memory
locations the CPU can point to.

• Ex: An address bus with a width of 32 bits can carry 232


= 4,294,967,296 unique addresses, which allows the CPU to
access up to 4 GB of memory (since each address typically
represents a byte).

• Address bus transmits these memory addresses, enabling


communication between the CPU and the memory or other
devices.
3. Control lines: (also called control bus) are used to control:

a. The access to the data (being transferred over the data bus).

b. The use of the data lines and address lines.

• Importance of control:

- since all components share the same data and address lines,
there must be a system in place to manage which component
is allowed to use them at any given time.

- Without this control, there would be confusion and errors


in data transfers.
END OF LECTURE

You might also like