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

COA Learning Guide

Chapter 2 covers the fundamentals of Computer Organization and Architecture, detailing the roles and functions of various hardware components including the CPU, memory, and input-output devices. It outlines performance standards, learning outcomes, and provides definitions and explanations of key concepts such as computer organization, architecture, and the structure and function of components like the motherboard and power supply. The chapter also includes assessments to evaluate understanding of the material presented.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

COA Learning Guide

Chapter 2 covers the fundamentals of Computer Organization and Architecture, detailing the roles and functions of various hardware components including the CPU, memory, and input-output devices. It outlines performance standards, learning outcomes, and provides definitions and explanations of key concepts such as computer organization, architecture, and the structure and function of components like the motherboard and power supply. The chapter also includes assessments to evaluate understanding of the material presented.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 72

CHAPTER 2: COMPUTER ORGANISATION AND ARCHITECTURE

2.1 Introduction
This unit covers the competencies required to understand Computer Organisation and
Architecture. It involves understanding principles of computer organisation and design,
understanding central processing unit functions, understanding computer memory
organization, understanding input-output functions and understanding computer arithmetic and
logic.

2.2 Performance Standard


1. Identified hardware components of a computer
2. Prescribed CPU specifications according to a user‟s needs
3. Verified CPU specifications for a given computer
4. Prescribed memory specifications according to a user‟s needs

2.3 Learning Outcomes


2.3.1 List of Learning Outcomes
1. Understand principles of Computer Organization and Design
2. Understand Central Processing Unit functions
3. Understand computer memory organization
4. Understand Input-Output functions
5. Understand computer arithmetic and logic
2.3.2 Learning Outcome 1: Understand Principles of Computer Organization and Design
2.3.2.1 Learning Activities

Learning Outcome 1: Understand Principles of Computer Organisation and Design


Learning Activities Special Instructions

1.1. Computer organisation is defined Activities may be carried out in


1.2. Computer architecture is explained groups or as individual
1.3. Structure and function of computer components is
explained
1.4. Hardware components of a computer are identified

2.3.2.2 Information Sheet No 2/LO1: Understand Principles of Computer Organisation and


Design

Introduction
This learning outcome covers defining computer organisation, explaining and structure and
function of computer components and identifying hardware components.

Definition of key terms


Computer Organisation: refers to the level of abstraction above the digital logic level, but
below the operating system level.
Computer architecture: is a set of rules and methods that describe the functionality,
organization, and implementation of computer systems
Computer memory: is any physical device capable of storing information temporarily, like
RAM (random access memory), or permanently, like ROM (read-only memory).
Peripherals: Input or output devices that are connected to a computer. E.g. keyboard
Input peripherals: Allows user input, from the outside world to the computer. Example:
Keyboard, Mouse etc.
Output peripherals: Allows information output, from the computer to the outside world e.g.:
Printer, Monitor etc.
Input-Output peripherals: Allows both input (from outside world to computer) as well as,
output (from computer to the outside world). Example: Touch screen etc.
Computer Architecture: refers to those attributes of a system that have a direct impact on the
logical execution of a program.
Computer Organization: refers to the operational units and their interconnections that realize
the architectural specifications.
Structure: The way in which components relate to each other.
Function: the operation of individual components as part of the structure
Computer organization and architecture
Computer Organization is the realization of what is specified by the computer architecture. It
deals with how operational attributes are linked together to meet the requirements specified by
computer architecture. Some organizational attributes are hardware details, control signals,
peripherals.

Computer Architecture deals with giving operational attributes of the computer or Processor
to be specific. It deals with details like physical memory, ISA of the processor, the no of bits
used to represent the data types, Input Output mechanism and technique for addressing
memories.
Examples are things that are transparent to the programmer:
● control signals
● interfaces between computer and peripherals
● the memory technology being used

Structure and function of computer components


Motherboard
As the given name, we can say this is either the start or endpoint of all components.
It is either the origin point of other parts of the computer or where every other component
connects to. In a way, it is a lot like what you would refer to your home country as: the
motherland.

It is basically a circuit board of a decent size, depending on the size of the computer we‟re
dealing with. It facilitates the communication of the other components in the computer. There
are ports on the motherboard that face the outside of the computer, allowing you to plug in
different components into your computer and also to charge it.

Most motherboards also allow you to scale up by including slots that allow for expansion. You
could add in components like CPUs and RAMs, Video cards, and so on. You can also expand
the motherboard by adding more ports that allow you to connect even more auxiliary devices
to your computer. In other words, you have control over just what your computer‟s capabilities
are.
Apart from this, the motherboard plays other roles like storing some simple information when
the computer is off, such as the system time. That‟s why your computer always tells you the
correct time, even when you turn it on after a long time
.
Figure 1:Motherboard

Power supply
As the name suggests, it powers all other components of the machine. It usually plugs into the
motherboard to power the other parts. The power supply connects to either an internal battery
(on a laptop) or a plug for an outlet (on a desktop).
They have different input voltage depending on the machine/computer specifications.

Figure 2: Power supply

Central Processing Unit (CPU)


Sometimes it's referred to as the computer‟s brain. It is the workhorse of the machine. It
performs the calculations needed by a system, and can vary in speed. The work that a CPU
does generates heat, which is why your computer has a fan inside. A more powerful CPU is
necessary for intense computer work like editing high-definition video or programming
complex software.
Figure 3:Central Processing Unit (CPU)

Random Access Memory (RAM)


RAM is a temporary memory. When you open an application in our computer, the computer
will place that application and all its data in the RAM. When you close the application, then
space in the RAM is freed. That is why your computer gets so slow when you have too many
applications open; your RAM is probably being used at capacity.

Since RAM is only temporary, it has a volatile nature. The minute you turn your computer off,
all of the memory that is stored in RAM is lost. That‟s why you‟re advised to keep saving the
work you do in applications as you go along to avoid losing all of it in case your computer
suddenly goes off.

The more RAM you have, the greater the number of programs that you can run
simultaneously.

Figure 4: RAM

Hard disk /Solid State Disk


Remember that we said RAM is volatile due to its temporary nature, which means the
computer still needs a more permanent form of data storage. That‟s why the hard drive or solid
state drive exists. Traditionally, the hard drive is a drum with several platters piled on it and
spinning, and the physical arm then writes data onto these platters. These disks are very slow
because of the mechanics through which data is stored, although latest hard drives, solid state
drives, are much faster.

Figure 5: Hard disk

Solid state drives have the same kind of memory as the one on your phone or flash drive, also
known as flash memory. They cost more but are also faster and more efficient than traditional
hard drives.

The data stored in the hard drive does not disappear when you switch your computer off. It
will be there when you switch the computer back on. You are, however, advised to keep it far
away from magnets as they could damage it and cause you to lose your information.

Video Card
The video card is a dedicated unit for handling image output to be displayed by the monitor.
They come with their own RAM, dedicated to this singular purpose. If your work involves
highly visual work at very high definitions, then you should get yourself a video card to take
the load off your RAM.

Sometimes, the computer may have integrated graphics, where some of the RAM is borrowed
for graphics processing. This happens frequently on laptops, because there is a need to save
space. Using integrated graphics is much less expensive using a graphics card, but is not
sufficient for intense graphics functions.

Figure 6:Video Card

Optical devices
These have become a lot less common today, with many machines doing away with them
altogether. An optical drive is used to read CDs and DVDs, which can be used to listen to
music or watch movies. They can also be used to install software, play games, or write new
information into a disk.

Figure 7: Optical device drive

In summary, here's the inside of a desktop computer with its parts labeled:
Figure 8: Computer Internal components

Conclusion
At the end of this learning outcome, the learner should be able to define computer
organisation, explain and structure and function of computer components and identify
hardware components.

Further Reading
https://www.com/computer-organization-mcqs-basic-operational-concept/

2.3.2.3 Self-Assessment

Written Assessment
1. Which memory device is generally made of semiconductors?
a) RAM
b) Hard-disk
c) Floppy disk
d) CD ROM
2. The register which holds the address of the location to or from which data are to be
transferred is called
a) Instruction registers
b) Index register
c) Memory address
d) Memory data register
3. The device which is used to connect a peripheral to bus is called
a. Control Register
b. Interface
c. Communication Protocol
d. None of the above
4. Which of the following is not a form of memory?
a. Instruction cache
b. Instruction register
c. Instruction opcode
d. Both (a and b)
5. Which memory is difficult to interface with the processor?
a. Static memory
b. Dynamic memory
c. ROM
d. None of the Above
6. Which one of the following is an optical device?
a. DVD
b. Mouse
c. Desktop
d. Monitor.
7. What is computer hardware?
a. A medium for data communications
b. A physical device that is driven by data
c. A physical that is driven by software
d. All of the above
8. What does R in RAM stand for?
a. Re-write
b. Read
c. Readable
d. Random
9. DVD stands for?
a. Digital video data
b. Direct video
c. Digital versatile disk
d. Direct vertical disk
10. Which among the following storage devices is considered portable
a. Hard Disk
b. Magnetic Tape
c. Flash Drive
d. ROM
Oral Assessment
1. Differentiate functional and basic components.
2. Describe the functions of the RAM
3. What is a chipset?

Practical Assessment
You have been presented a set of hardware components. From the set, identify
 The hard disk
 Memory
 Power Supply
 An optical disk

2.3.2.4 Tools, Equipment, Supplies and Materials


● Computer
● Internet connectivity
● Stationery
● Instruction material

2.3.2.5 References

1. https://mrcet.com/downloads/digital_notes/IT/COMPUTER%20ORGANIZATION%2
0(R17A0510).pdf
2. The "History of Computing" assembled Society by the IEEE Computer in 1996.
2.3.3 Learning Outcome 2: Understand Central Processing Unit functions
2.3.3.1 Learning Activities

Learning Outcome 2: Understand Central Processing Unit functions


Learning Activities Special Instructions

2.1 The Central Processing Unit is explained. Activities may be carried out in
2.2 CPU architecture is explained groups or as individual
2.3 Role of registers is explained
2.4 Instruction representation and execution is explained
2.5 CPU specifications are prescribed for a user
2.6 CPU specifications are verified for a given computer

2.3.3.2 Information Sheet No 2/LO2: Understand Central Processing Unit functions

Introduction
This learning outcome covers explaining the Central Processing Unit design, CPU architecture,
role of registers, instruction representation and execution, prescribing CPU specifications and
verifying CPU specifications for a given computer.

Definitions
❏ CPU is the electronic circuitry within a computer that carries out the instructions of a
computer program.
❏ Registers, a memory location within the actual processor that works at very fast speeds. It
stores instructions which are waiting to be decoded or executed.

CPU
It is s the electronic circuitry within a computer that carries out the instructions of a computer
program by performing the basic arithmetic, logical, control and input/output (I/O) operations
specified by the instructions.

Types of Processors
There are 2 different types of processors. These include:
● Complex instruction set computers (CISC)
● Reduced instruction set computers (RISC)
CISC
These processors can do complex operations, which can be carried out in just one instruction.
They have many different addressing modes and a wide range of instructions that can be used.
For example, a CISC processor might have a 'complicated' instruction designed into the
hardware called 'POWER'. This can take one number from a register, find the power of that
number, held in a different register, and then store the result in yet a third register. So, 2 to the
power 4 would be calculated as 16 and this would be stored in a third register. This would all
be done using one complex instruction, which might take about 3 or 4 CPU clock cycles to
complete.

RISC
There are also CPUs that are known as RISC (pronounced „risk‟), or Reduced Instruction Set
Computers. RISC processors such as ultra-SPARC and ALPHA use a much smaller, simpler
set of instructions than CISC processors and so to carry out any particular programming task
may take many „fetch decode execute‟ cycles. RISC processors, however, are much more
efficient at processing huge blocks of data than CISC.

Standard CPU specification factors


There are four key factors about CPU architecture that affect its performance:
● Cores
○ A CPU can contain one or more processing units. Each unit is called a core. A
core contains an ALU, control unit and registers. It is common for computers to
have two (dual), four (quad) or even more cores. CPUs with multiple cores have
more power to run multiple programs at the same time.
● Clock speed
○ The clock speed - also known as clock rate - indicates how fast the CPU can run.
This is measured in megahertz (MHz) or gigahertz (GHz) and corresponds with
how many instruction cycles the CPU can deal with in a second.
● Cache size
○ Cache is a small amount of memory which is a part of the CPU - closer to the
CPU than RAM. It is used to temporarily hold instructions and data that the CPU
is likely to reuse.
● Processor type
○ Processor type can be either RISC or CISK. CPU ARCHITECTURE

CPU itself has the following three components.


● ALU(Arithmetic Logic Unit)
● Control Unit
● Memory Unit (Registers)

Control Unit
This unit controls the operations of all parts of the computer but does not carry out any actual
data processing operations.
Functions of this unit are −
● It is responsible for controlling the transfer of data and instructions among other units of
a computer.
● It manages and coordinates all the units of the computer.
● It obtains the instructions from the memory, interprets them, and directs the operation of
the computer.
● It communicates with Input/output devices for transfer of data or results from storage.
● It does not process or store data.

ALU (Arithmetic Logic Unit)


This unit consists of two subsections namely,
● Arithmetic Section
● Logic Section

Arithmetic Section
Function of the arithmetic section is to perform arithmetic operations like addition, subtraction,
multiplication, and division. All complex operations are done by making repetitive use of the
above operations.

Logic Section
Function of the logic section is to perform logic operations such as comparing, selecting,
matching, and merging of data.

Role of Registers
Processor register is a quickly accessible location available to a digital processor's central
processing unit.

The registers are an integral part of the CPU. They are a type of memory that can be accessed
very quickly compared to other types of memory. The pieces of information they hold are
needed by the CPU to run each program instruction during a 'fetch-decode-execute cycle' or
can be used to hold values that are generated as part of the ALU working on data. There are a
number of very special registers that do very specific jobs.
Figure 9:CPU Registers

Buses
A BUS is a data connection between two or more devices connected to the computer. For
example, a bus enables a computer processor to communicate with the memory or a video card
to with the memory.

These buses carry different types of signals. The same types of buses carry only one type of
signal. These buses help to increase the efficiency and accuracy of working.
A computer consists of many components such as motherboard, memory, input/output devices.
These devices work with the help of buses. PC motherboards have buses for expansion and
external devices, all computers have three basic buses.

Figure 10: Buses

We have three different types of buses. These are:


● DATA BUS
○ The control bus controls the traffic of data. It helps to send data, according
to the request of the user and PC.
● ADDRESS BUS
○ Data bus helps to connect the Microprocessor (CPU) and Memory (RAM).
● Control bus
○ The address bus carries the address of the location of memory.

Instruction representation and execution

Fetch Execute Cycle


This is the basic operation (instruction) cycle of a computer (also known as the fetch decode
execute cycle).

During the fetch execute cycle, the computer retrieves a program instruction from its memory.
It then establishes and carries out the actions that are required for that instruction.
The cycle of fetching, decoding, and executing an instruction is continually repeated by the
CPU whilst the computer is turned on.

Figure 11:Fetch Execute Cycle

1. Fetch
The first step the CPU carries out is to fetch some data and instructions (program) from main
memory then store them in its own internal temporary memory areas. These memory areas are
called 'registers'.

 For this to happen, the CPU makes use of a vital hardware path called the 'address bus'.
 The CPU places the address of the next item to be fetched on to the address bus.
 Data from this address then moves from main memory into the CPU by travelling
along another hardware path called the 'data bus'.
2. Decode
 The next step is for the CPU to make sense of the instruction it has just fetched. This
process is called 'decode'.
 The CPU is designed to understand a specific set of commands. These are called the
'instruction set' of the CPU. Each make of CPU has a different instruction set.
 The CPU decodes the instruction and prepares various areas within the chip in
readiness of the next step.

3. Execute
This is the part of the cycle when data processing actually takes place. The instruction is
carried out upon the data (executed). The result of this processing is stored in yet another
register.
Once the execute stage is complete, the CPU sets itself up to begin another cycle once more.

Instruction Set
Instruction sets are instruction codes to perform some task. It is classified into five categories.

The instruction set, also called ISA (instruction set architecture) is part of a computer that
pertains to programming, which is basically machine language. The instruction set provides
commands to the processor, to tell it what it needs to do. The instruction set consists of
addressing modes, instructions, native data types, registers, memory architecture, interrupt, and
exception handling, and external I/O.

An example of an instruction set is the x86 instruction set, which is common to find on
computers today. Different computer processors can use almost the same instruction set while
still having very different internal design.

Both the Intel Pentium and AMD Athlon processors use nearly the same x86 instruction set. An
instruction set can be built into the hardware of the processor, or it can be emulated in software,
using an interpreter. The hardware design is more efficient and faster for running programs than
the emulated software version.

Examples of instruction set


 ADD - Add two numbers together.
 COMPARE - Compare numbers.
 IN - Input information from a device, e.g., keyboard.
 JUMP - Jump to designated RAM address.
 JUMP IF - Conditional statement that jumps to a designated RAM address.
 LOAD - Load information from RAM to the CPU.
 OUT - Output information to device, e.g., monitor.
 STORE - Store information to RAM.

Conclusion
At the end of this learning outcome, the learner should be able to explain the Central
Processing Unit design, the CPU architecture, the role of registers and instruction
representation and execution, prescribe CPU specifications and verify CPU specifications for a
given computer.

Further Reading
1. https://www.tutorialspoint.com/computer_logical_organization/index.htm
2. https://www.javatpoint.com/computer-organization-and-architecture-tutorial

2.3.3.3 Self-Assessment

Written Assessment
1. A central processing unit (CPU) consists of two main parts:
a. Control unit and arithmetic logic unit.
b. Control unit and RAM.
c. Motherboard and arithmetic logic unit.
d. Control unit and motherboard.
2. The CPU control unit is responsible for
a. obtaining instructions
b. interpreting instructions
c. all logic functions
d. both A and B
3. DMA module can communicate with the CPU through
a. Interrupt
b. Cycle stealing
c. Branch instruction
d. None of the above
4. The ALU of a computer
a. Can perform addition, subtraction
b. Perform all types of arithmetic operation
c. Can perform AND OR and Multiplication
d. Contains number of counters
5. CPU gets the address of next instruction to be processed from
a. Instruction register
b. Memory address register
c. Index register
d. Program counter
6. Which one of the following devices is referred to as the „brain‟ of the computer system?
a. CPU
b. CD-Rom
c. Mouse
d. Scanner
7. What is the other name for the Mother board
a. System processor
b. System platform
c. System unit
d. System board
8. What makes the computer to be an „electronic‟ machine?
a. It works using electricity
b. It works without moving parts
c. It has a CPU
d. It has moving parts
9. What is the name given to devices designed to protect the computer from static
electricity?
a. Anti-static devices
b. Power surge protectors
c. Personal equipment
d. Computer Hardware

Oral Assessment
Describe the role of buses.

Practical Assessment
Identify the following CPU specifications from your computer
 Clock Speed
 Manufacturer
 Generation

2.3.3.4 Tools, Equipment, Supplies and Materials


● Computer
● Internet connectivity
● Stationery
● Instruction material

2.3.3.5 References
1. https://www.geeksforgeeks.org/computer-organization-and-architecture-tutorials/
2. https://tutorialspoint.dev/computer-science/computer-organization-and-architecture
2.3.4 Learning Outcome 3: Understand Computer Memory Organization
2.3.4.1 Learning Activities

Learning Outcome 3: Understand Computer Memory Organization


Learning Activities Special Instructions

3.1 Memory organization is explained. Activities may be carried out in


3.2 Various storage technologies are explained. groups or as individual
3.3 Cache and Virtual memory are explained
3.4 Memory specifications are prescribed for a user
3.5 Memory specifications are verified for a given computer

2.3.4.2 Information Sheet 2/LO3: Understand Computer Memory Organization

Introduction

This learning outcome covers explaining memory organisation, various storage technologies,
cache and virtual memory, prescribing memory specifications for a user and verifying memory
specifications for a given computer.

Definition of key terms


 Memory
○ It is any physical device capable of storing information temporarily, or
permanently. Memory devices utilize integrated circuits and are used by
operating systems, software, and hardware.
○ is the storage space in the computer, where data is to be processed and
instructions required for processing are stored
 Memory unit
○ It is the collection of storage units or devices together.
 Memory hierarchy
○ It is an organizational structure in which memory units are ranked according to
levels of importance.
○ The computer memory hierarchy ranks components in terms of response times,
with processor registers at the top of the pyramid structure and tape backup at the
bottom.
 Virtual memory
○ Is a memory management capability of an operating system (OS) that uses
hardware and software to allow a computer to compensate for physical memory
shortages by temporarily transferring data from random access memory (RAM)
to disk storage

 Cached memory
○ a small-sized type of volatile computer memory that provides high-speed
data access to a processor and stores frequently used computer programs,
applications and data
 Volatile Memory: This loses its data, when power is switched off.
 Non-Volatile Memory: This is a permanent storage and does not lose any data
when power is switched off.

Memory Organization in Computer Architecture


Generally, memory/storage is classified into 2 categories:
● Volatile Memory: This loses its data, when power is switched off.
● Non-Volatile Memory: This is a permanent storage and does not lose any data when
power
is switched off.

The total memory capacity of a computer can be visualized by hierarchy of components. The
memory hierarchy system consists of all storage devices contained in a computer system from
the slow Auxiliary Memory to fast Main Memory and to smaller Cache memory.

Figure 12:Memory Organization in Computer Architecture

Memory is primarily of three types −


● Cache Memory
● Primary Memory/Main Memory
● Secondary Memory
Cache Memory
Cache memory is a very high speed semiconductor memory which can speed up the CPU.
It acts as a buffer between the CPU and the main memory. It is used to hold those parts of data
and program which are most frequently used by the CPU. The parts of data and programs are
transferred from the disk to cache memory by the operating system, from where the CPU can
access them.

Figure 13:Cache Memory

Operations of the cache memory


■ Requests regarding the contents of memory location are done by CPU.
■ Check cache for this data
■ If present, get from cache (fast)
■ If not present, read required block from main memory to cache
■ Then deliver from cache to CPU

Cache deals with the tags so as to identify which block of main memory is present in each
cache slot

Advantages
The advantages of cache memory are as follows −
● Cache memory is faster than main memory.
● It consumes less access time as compared to main memory.
● It stores the program that can be executed within a short period of time.
● It stores data for temporary use.

Disadvantages
The disadvantages of cache memory are as follows −
● Cache memory has limited capacity.
● It is very expensive.

Primary Memory (Main Memory)


Primary memory holds only those data and instructions on which the computer is currently
working. It has a limited capacity and data is lost when power is switched off. (Volatile)
It is generally made up of semiconductor devices. These memories are not as fast as registers.
The data and instruction required to be processed resides in the main memory. It is divided into
two subcategories RAM and ROM.

RAM (Random Access Memory)


Random access memory (RAM) is the best known form of computer memory. RAM is
considered "random access" because you can access any memory cell directly if you
know the row and column that intersect at that cell.

Types of RAM:-
● Static RAM (SRAM)
● Dynamic RAM (DRAM)

Static RAM (SRAM)


❏ Stores data using the flip-flop state
❏ Retains value indefinitely, as long as it is kept powered.
❏ Mostly used to create cache memory of CPU.
❏ Faster and more expensive than DRAM.

Dynamic RAM (DRAM)


❏ Each cell stores a bit with a capacitor and transistor.
❏ Large storage capacity
❏ Needs to be refreshed frequently.
❏ Used to create main memory.
❏ Slower and cheaper than SRAM.

NVRAM:
❏ It is a category of Random Access Memory (RAM) that retains stored data even if
the power is switched off.
❏ NVRAM uses a tiny 24-pin dual inline package (DIP) integrated circuit chip,
which helps it to gain the power required to function from the CMOS battery on
the motherboard.
❏ NVRAM monitors several system parameters, such as Ethernet the MAC address,
serial number, date of manufacture, HOSTID, etc.
❏ NVRAM is a non-volatile memory type that provides the random access facility.

ROM: Read Only Memory


It is the memory from which we can only read but cannot write on it. This type of memory is
non-volatile.

The information is stored permanently in such memories during manufacture.


ROM stores such instructions that are required to start a computer. This operation is referred to
as bootstrap.

ROM chips are not only used in the computer but also in other electronic items like washing
machine and microwave oven.

There are five basic ROM types:


➢ ROM - Read Only Memory
➢ PROM - Programmable Read Only Memory
➢ EPROM - Erasable Programmable Read Only Memory
➢ EEPROM - Electrically Erasable Programmable Read Only Memory
➢ Flash EEPROM memory

Characteristics of Main Memory


● These are semiconductor memories.
● It is known as the main memory.
● Usually volatile memory.
● Data is lost in case power is switched off.
● It is the working memory of the computer.
● Faster than secondary memories.
● A computer cannot run without the primary memory.

Secondary Memory
This type of memory is also known as external memory or non-volatile.

It is slower than the main memory. These are used for storing data/information permanently.
The CPU does not directly access these memories; instead they are accessed via input-output
routines. The contents of secondary memories are first transferred to the main memory, and then
the CPU can access it. For example, disk, CD-ROM, DVD, etc.

Figure 14:Secondary Memory

Characteristics of Secondary Memory


● These are magnetic and optical memories.
● It is known as the backup memory.
● It is a non-volatile memory.
● Data is permanently stored even if power is switched off.
● It is used for storage of data in a computer.
● Computers may run without the secondary memory.
● Slower than primary memories.
Depending on whether secondary memory device is part of CPU or not, there are two types of
secondary memory – fixed and removable.

Table 1: Primary and secondary memory

Parameter Primary memory Secondary memory

Nature The primary memory is categorized The secondary memory is always a non-
as volatile & nonvolatile memories. volatile memory.

Alias These memories are also called Secondary memory is known as a Backup
internal memory. memory or Additional memory or Auxiliary
memory.
Access Data is directly accessed by the Data cannot be accessed directly by the
processing unit. processor. It is first copied from secondary
memory to primary memory. Only then
CPU can access it.

Formation It's a volatile memory meaning data It's a non-volatile memory so that that data
cannot be retained in case of power can be retained even after power failure.
failure.

Storage It holds data or information that is It stores a substantial amount of data and
currently being used by the information. Capacity is generally from
processing unit. Capacity is usually 200GB to terabytes.
in 16 to 32 GB

Accesses Primary memory can be accessed by Secondary memory is accessed by I/O


the data bus. channels.

Expense Primary memory is costlier than Secondary memory is cheaper than primary
secondary memory. memory.

Storage Devices

SSD Solid State Drive


It is a storage device that uses integrated circuit assemblies as memory to store data.
SSD are also known as solid-state disks although SSDs do not have physical disks.

Form-factors and protocols such as SATA and SAS of traditional hard disk drive (HDD) may
be used by SSD, greatly simplifying usage of SSDs in computers.

New form factors such as the M.2 form factor, and new I/O protocols such as NVM Express
have been developed to address specific requirements of the Flash memory technology used in
SSDs.

Characteristics
● There are no moving mechanical components in SSD. This makes them
different from conventional electromechanical drives such as hard disk drives
(HDDs) or floppy disks, which contain movable read/write heads and spinning
disks.
● SSDs are typically more resistant to physical shock.
● Run silently, have quicker access time and lower latency compared to
electromechanical devices.

Optical storage devices


This is an electronic data storage medium that can be written to and read from using a low-
powered laser beam.

Optical storage devices save data as patterns of dots that can be read using light. A laser
beam is the usual light source.

The data on the storage medium is read by bouncing the laser beam off the surface of the
medium.

Dots can be created using the laser beam (for media that is writable such as CD-Rs). The
beam is used in a high-power mode to actually mark the surface of the medium, making a dot.
This process is known as „burning‟ data onto a disc.
Magnetic Storage Device
A magnetic disk is a storage device that uses a magnetization process to write, rewrite and
access data. It is covered with a magnetic coating and stores data in the form of tracks, spots
and sectors. Hard disks and zip disks are common examples of magnetic disks.

Virtual Memory

Virtual Memory is a technique to increase the main memory capacity. It uses data swap
technology and hard disk area is used as virtual memory.
It is a technique that is implemented using both hardware and software. It maps memory
addresses used by a program, called virtual addresses, into physical addresses in computer
memory.

Benefits of having Virtual Memory


1. Large programs can be written, as virtual space available is huge compared to physical
memory.
2. Less I/O required, leads to faster and easy swapping of processes.
3. More physical memory available, as programs are stored on virtual memory, so they
occupy very less space on actual physical memory.

Following are the important differences between Cache Memory and Virtual Memory.

Table 2: Differences between Cache Memory and Virtual Memory

Key Cache Memory Virtual Memory


1 Objective Cache memory increases Virtual memory increases the main
CPU access speed. memory capacity.

2 Memory Cache memory is a Virtual memory is a technique and


Unit memory unit and is very involves hard disk and is slower to
fast to access. access.

3 Management CPU and related Operating System manages virtual


hardware manages cache memory.
memory.

4 Size Cache memory is small Size of virtual memory is much larger


in size. than cache memory.

5 Operation Cache memory keeps Virtual memory keeps the programs


recently used data. which are not getting accommodated in
main memory.

Key RAM specifications to consider


 Physical Size
RAM modules vary in physical size based on the type of computer they're used for and the
number of pins on the module. Dual Inline Memory Modules (DIMMs) with 168 pins are 5.25
inches long.

DIMMs with fewer pins are typically smaller, with more pins meaning a physically larger
module. DIMMs are commonly used in desktop computers, whereas laptops typically use Small
Outline Dual Inline Memory Modules (SODIMMs). SODIMMs use the same technology but
they're physically smaller, allowing them to fit in laptops.
 Amount of memory
The amount is another important specification to remember. Your computer can only hold so
much RAM and while going over the specified limit won't harm your computer, your PC will
only use as much of it as it was designed to use. Amount is commonly measured in gigabytes
(GB), though older or low-end computers may measure maximum RAM in megabytes (MB).
Some computers have two slots to install memory, others have four and some have even more.

 Type of memory
The memory type is important because this is where the majority of RAM's compatibility issues
lie. Multiple variations of Double Data Rate (DDR) memory technology are used in various
computers.
DDR2 is faster than DDR memory, while DDR3 memory is faster than both. If your computer
requires DDR3 memory, DDR2 memory won't work.
 Memory Speed
Memory speed is frequently denoted by "PC-" followed by a number that denotes the peak
transfer rate and bandwidth of that type of memory. For example, PC-2400's peak transfer rate is
around 2,400 megabytes per second (MB/s). The peak transfer rate basically denotes the best
performance possible for that memory. "PC2" and "PC3" simply refer to DDR2 and DDR3
memory, respectively.

The specifications may list the memory under a name known as the "friendly name," which looks
something like "DDR3-1066." In this case, 1066 represents the data transfer rate in millions per
second. All together, the memory specification may read something like "2 GB PC3-6400 DDR3
SODIMM."

Note: For hard disk storage, the capacity, usually in Gigabytes is the key factor to consider.

Conclusion
At the end of this learning outcome, the learner should be able to explain memory
organisation, various storage technologies, cache and virtual memory, prescribe memory
specifications for a user and verify memory specifications for a given computer.

Further Reading
1. https://www.tutorialspoint.com/computer_logical_organization/index.htm
2. https://www.javatpoint.com/computer-organization-and-architecture-tutorial

2.3.4.3 Self-Assessment

Written Assessment
1. Cache memory is used in a computer system to
a. Ensure fast booting
b. Replace static memory
c. Replace hard disk
d. Speed up memory access
2. Virtual memory of a computer system may be
a. Of unlimited size.
b. As big as maximum addressing capability of the computer system.
c. Of size equivalent to total capacity of secondary storage plus size of
RAM.
d. None of the above
3. Which of the following is not an advantage of Dynamic RAMs
a. High density
b. Low cost
c. High speed
d. No need of memory refresh
4. In the memory hierarchy the fastest memory
a. SRAM
b. Cache
c. Registers
d. DRAM
5. Cache memory is implemented using
a. Dynamic RAM
b. Static RAM
c. PROM
d. EPROM
6. Which one of the following is the odd one out?
a. Primary memory
b. Secondary memory
c. Tertiary memory
d. Cached memory
7. What makes SSD different from conventional electromechanical drives
a. they contain movable read/write heads
b. they have spinning disks
c. They do not have moving mechanical components
d. They are hard Disks
8. Which of the following Disks are more resistant to physical shock
a. SSDs
b. Floppy Disks
c. HDDs
d. None of the above
9. The following are all types of secondary memory except.
a. Hard drive
b. RAM
c. SSD
d. Flash
10. Which one of the following statements is true?
a. Primary memory is the main memory of the computer system.
b. Rom is part of the secondary memory
c. Secondary memory is not useful at all to the computer
d. Secondary memory is also called internal memory.
Oral Assessment
1. Describe DRAM
2. Differentiate between cache and virtual memory

Practical Assessment
1. Verify the memory and hard disk specifications of the computer provided.
2. Prescribe memory specifications for a user intending to install and use video and
graphics production software.

2.3.4.4 Tools, Equipment, Supplies and Materials


● Computer
● Internet connectivity
● Stationery
● Instruction material

2.3.4.5 References

1. https://www.geeksforgeeks.org/computer-organization-and-architecture-tutorials/
2. https://tutorialspoint.dev/computer-science/computer-organization-and-architecture
3. https://www.techwalla.com/articles/random-access-memory-specifications
2.3.5 Learning Outcome 4: Understand Input-Output functions
2.3.5.1 Learning Activities

Learning Outcome 4: Understand Input-Output functions


Learning Activities Special Instructions

4.1 Peripherals devices are explained Activities may be carried out in


4.2 Input-output processing is explained groups or as individual
4.3 Bus interface is explained
4.4 Modes of data transfer are explained
4.5 Input-output device specifications are prescribed
for a user
4.6 Input-output device specifications are verified
for a given computer

2.3.5.2 Information Sheet 2/LO4: Understand Input-Output functions

Introduction

This learning outcome covers the explaining categorizing the peripheral devices, explain
Input/output (I/O) processing, explain bus interface role in I/O and different modes of data
transfer. It also involves prescribing I/O specifications for a user and verifying I/O
specifications for a given computer.

Definition of key terms


 Peripheral: A peripheral device is an internal or external device that connects to a
computer but does not contribute to the computer's primary function, such as computing.
It helps end users access and use the functionalities of a computer.

 Bus: A bus is a subsystem that transfers data between computer components inside a
computer or between computers

Overview of peripheral devices


A peripheral is a device that can be attached to the computer processor. Peripheral devices can
be external, such as a mouse, keyboard, printer, monitor or scanner. Peripheral devices can
also be internal, such as a CD-ROM drive, DVD-R drive or modem.

Categories
We have different categories. These include;
● Input
● Output
● storage

Input Devices
A device that feeds data into a computer processor is called an input device.
Input can take a variety of forms, from commands you enter from the keyboard to data from
another computer or device.

Examples of input devices


Table 3: Examples of input devices

Device Description Image

Keyboard A keyboard resembles a


typewriter which contains a
set of keys used to input data
and control commands to the
computer. The most
common keyboard has 101
keys with 12 functions keys.

Mouse A mouse is a drawing and


pointing device. A mouse
has one or more buttons on
the top. When a user rolls a
mouse across the flat
surface, the cursor moves on
the screen in the direction of
mouse movement.

Touch screen This is the easiest way to


enter data using the finger
touch. A touch screen allows
the users to select an option
by pressing a specific part of
the screen.
Touchpad Many laptop computers use a
touchpad in front of the
keyboard. We move our
finger on the pad to move
the cursor on the screen.

Trackballs It is pointing devices and


contains a ball which can be
rotated in any direction. The
user spins the ball in a
different direction to move
the cursor on the screen.

Joystick It is a pointing device which


is used to move the cursor
position on the screen. A
joystick is a stick which has
a spherical ball at its lower
ends as well as its upper
ends. Joysticks are
commonly used in playing
the game.

Output Devices
A device that shows data from a computer processor is an output device.
Output can also appear in a variety of forms - text, video, graphics, and so on.

Examples of common output devices


Table 4: Examples of common output devices

Device Description Image


Monitor The most common output device
used with computers is the
monitor, which displays video
images and text.

Projectors Projectors are output devices


used mainly by companies,
schools, and churches to show
information to a large body of
people at the same time

Plotters Plotters are generally used


with engineering applications,
for generating a hard copy of
a digitally created design. In
addition, Plotters are also
often used by graphic artists,
architects, constructions
engineers etc

speakers/headphones These are hardware devices that


transform the signal from the
computer's sound card into audio

Backing Storage Devices


Backing storage is a device which holds and retains data.

These devices allow the user to save data in a more permanent way than RAM so that data is
not lost and may be used at a later time.

Peripheral specifications
These specifications should match the user‟s needs. If the user needs to save/store data, they
will need storage, a device categorized as storage will be ideal.
The user specification may entail a very long list of devices depending on the special purpose
at hand.

I/O Processing
I/O processor is a processor separate from the CPU designed to handle only input/output
processes for a device or the computer.

The I/O processor is capable of performing actions without interruption or intervention from
the CPU. The CPU only needs to initiate the I/O processor by telling it what activity to
perform. Once the necessary actions are performed, the I/O processor then provides the results
to the CPU.

Doing these actions allow the I/O processor to act as a bus to the CPU, carrying out activities
by directly interacting with memory and other devices in the computer. A more advanced I/O
processor may also have memory built into it, allowing it to perform actions and activities
more quickly.

Bus Interface unit (BIU)


BIU takes care of all data and addresses transfers on the buses for the EU (Execution Unit) like
sending addresses, fetching instructions from the memory, reading data from the ports and the
memory as well as writing data to the ports and the memory. EU has no direct connection with
System Buses so this is possible with the BIU. EU and BIU are connected with the Internal
Bus.

BUS: is a communication system that transfers data between components inside a computer, or
between computers

Interface: is a hardware circuitry between the microcomputer and the I/O devices. It provides
all the input/output transfer.
They connect/interface the computer and the peripherals.
Figure 15:Connection of I/O bus to I/O device

Types of buses
Each bus defines its set of connectors to physically plug devices, cards or cables together. There
are two types of buses: internal and external. Internal buses are connections to various internal
components. External buses are connections to various external components. There are different
kinds of slots that internal and external devices can connect to.

Internal

Types of Slots
There are many different kinds of internal buses, but only a handful of popular ones. Different
computers come with different kinds and number of slots. It is important to know what kind
and number of slots you have on your computer before you go out and by a card that matches
up to a slot you don‟t have.

PCI
PCI (Peripheral Component Interconnect) is common in modern PCs. This kind of bus is being
succeeded by PCI Express. Typical PCI cards used in PCs include: network cards, sound cards,
modems, extra ports such as USB or serial, TV tuner cards and disk controllers. Video cards
have outgrown the capabilities of PCI because of their higher bandwidth requirements.

Figure 16:PCI Slots

PCI Express
PCI Express was introduced by Intel in 2004. It was designed to replace the general-purpose
PCI expansion bus and the AGP graphics card interface.

PCI express is not a bus but instead a point-to-point connection of serial links called lanes. PCI
Express cards have faster bandwidth then PCI cards which make them more ideal for high-end
video cards.
PCMCIA
PCMCIA (also referred to as PC Card) is the type of bus used for laptop computers. The name
PCMCIA comes from the group who developed the standard: Personal Computer Memory
Card International Association.

PCMCIA was originally designed for computer memory expansion, but the existence of a
usable general standard for notebook peripherals led to many kinds of devices being made
available in this form. Typical devices include network cards, modems, and hard disks.

AGP
AGP (Accelerated Graphics Port) is a high-speed point-to-point channel for attaching a
graphics card to a computer‟s motherboard, primarily to assist in the acceleration of 3D
computer graphics. AGP has been replaced over the past couple years by PCI Express. AGP
cards and motherboards are still available to buy, but they are becoming less common.

Figure 17:AGP Slot

Types of Cards

Video Card
A video card (also known as graphics card) is an expansion card whose function is to generate
and output images to a display. Some video cards offer added functions, such as video capture,
TV tuner adapter, ability to connect multiple monitors, and others. Most video cards all share
similar components.

They include a graphics processing unit (GPU) which is a dedicated microprocessor optimized
for 3D graphics rendering. It also includes video BIOS that contains the basic program that
governs the video card‟s operations and provides the instructions that allow the computer and
software to interface with the card. If the video card is integrated in the motherboard, it may
use the computer RAM memory. If not, it will have its own video memory called Video RAM.

This kind of memory can range from 128MB to 2GB. A video card also has a RAMDAC
(Random Access Memory Digital-to-Analog Converter) which takes responsibility for turning
the digital signals produced by the computer processor into an analog signal which can be
understood by the computer display. Lastly, they all have outputs such as an HD-15 connector
(standard monitor cable), DVI connector, S-Video, composite video or component video.

Figure 18:Video/Graphics Card

Sound Card
A sound card is an expansion card that facilitates the input and output of audio signals to/from
a computer under control of computer programs. Typical uses for sound cards include
providing the audio component for multimedia applications such as music composition, editing
video or audio, presentation/education, and entertainment. Many computers have sound
capabilities built in, while others require additional expansion cards to provide for audio
capability.

Network Card
A network card is an expansion card that allows computers to communicate over a computer
network. It allows users to connect to each other either by using cables or wirelessly. Although
other network technologies exist, Ethernet has achieved near-ubiquity for a while now. Every
Ethernet network card has a unique 48-bit serial number called a MAC address, which is
stored in ROM carried on the card.

Figure 19:Network Card

External

Types of Connections
USB
USB (Universal Serial Bus) is a serial bus standard to interface devices. USB was designed to
allow many peripherals to be connected using a single standardized interface socket and to
improve the plug-and-play capabilities by allowing devices to be connected and disconnected
without rebooting the computer.

Other convenient features include providing power to low-consumption devices without the
need for an external power supply and allowing many devices to be used without requiring
manufacturer specific, individual device drivers to be installed. USB is by far the dominating
bus for connecting external devices to your computer.

Figure 20:USB Connectors

Firewire
Firewire (technically known as IEEE 1394 and also known as i.LINK for Sony) is a serial bus
interface standard for high-speed communications and isochronous real-time data transfer,
frequently used in a personal computer. Firewire has replaced Parallel ports in many
applications. It has been adopted as the High Definition Audio-Video Network Alliance
(HANA) standard connection interface for A/V (audio/visual) component communication and
control. Almost all modern digital camcorders have included this connection.

Figure 21:Firewire Cable

PS/2
The PS/2 connector is used for connecting some keyboards and mice to a PC compatible
computer system. The keyboard and mouse interfaces are electrically similar with the main
difference being that open collector outputs are required on both ends of the keyboard interface
to allow bidirectional communication. If a PS/2 mouse is connected to a PS/2 keyboard port,
the mouse may not be recognized by the computer depending on configuration.

Figure 22:PS/2 Ports

Modes of data transfer:


There are different modes of data transfer. We are going to have a look at the following:
➔ Programmed I/O
➔ Interrupt initiated I/O
➔ Direct memory access(DMA)

Programmed I/O
Programmable I/O is one of the I/O techniques other than the interrupt-driven I/O and direct
memory access (DMA). The programmed I/O is the simplest type of I/O technique for the
exchanges of data or any types of communication between the processor and the external
devices. With programmed I/O, data is exchanged between the processor and the I/O module.
The processor executes a program that gives it direct control of the I/O operation, including
sensing device status, sending a read or write command, and transferring the data. When the
processor issues a command to the I/O module, it must wait until the I/O operation is
complete. If the processor is faster than the I/O module, this is wasteful of processor time.

The overall operation of the programmed I/O can be summarized as follows:


 The processor is executing a program and encounters an instruction relating to I/O
operation.
 The processor then executes that instruction by issuing a command to the appropriate
I/O module.
 The I/O module will perform the requested action based on the I/O command issued by
the processor (READ/WRITE) and set the appropriate bits in the I/O status register.
 The processor will periodically check the status of the I/O module until it finds that the
operation is complete.
I/O Commands
Figure 23:Programmed I/O Mode Input Data Transfer

To execute an I/O-related instruction, the processor issues an address, specifying the particular
I/O module and external device, and an I/O command. There are four types of I/O commands
that an I/O module may receive when it is addressed by a processor:
● Control: Used to activate a peripheral and tell it what to do. For example, a magnetic-
tape unit may be instructed to rewind or to move forward one record. These commands
are tailored to the particular type of peripheral device.
● Test: Used to test various status conditions associated with an I/O module and its
peripherals. The processor will want to know that the peripheral of interest is powered on
and available for use. It will also want to know if the most recent I/O operation is
completed and if any errors occurred.
● Read: Causes the I/O module to obtain an item of data from the peripheral and place it in
an internal buffer. The processor can then obtain the data item by requesting that the I/O
module place it on the data bus.
● Write: Causes the I/O module to take an item of data (byte or word) from the data bus
and subsequently transmit that data item to the peripheral.

Advantages and disadvantages of programmed I/O



Advantages - simple to implement

- very little hardware support

Disadvantages - busy waiting

- ties up CPU for long period with no useful work

Interrupt- initiated I/O


Interrupt I/O is a way of controlling input/output activity whereby a peripheral or terminal that
needs to make or receive a data transfer sends a signal. This will cause a program interrupt to
be set at a time appropriate to the priority level of the I/O interrupt.

Relative to the total interrupt system, the processors enter an interrupt service routine. The
function of the routine will depend upon the system of interrupt levels and priorities that is
implemented in the processor. The interrupt technique requires more complex hardware and
software, but makes far more efficient use of the computer‟s time and capacities.
Figure 24:Interrupt- initiated I/O

For input, the device interrupts the CPU when new data has arrived and is ready to be retrieved by
the system processor. The actual actions to perform depend on whether the device uses I/O ports or
memory mapping.

For output, the device delivers an interrupt either when it is ready to accept new data or to
acknowledge a successful data transfer. Memory-mapped and DMA-capable devices usually generate
interrupts to tell the system they are done with the buffer.

Here the CPU works on its given tasks continuously. When an input is available, such as when
someone types a key on the keyboard, then the CPU is interrupted from its work to take care of the
input data. The CPU can work continuously on a task without checking the input devices, allowing
the devices themselves to interrupt it as necessary.

Basic Operations of Interrupt

1. CPU issues read command.


2. I/O module gets data from peripheral whilst CPU does other work.
3. I/O module interrupts CPU.
4. CPU requests data.
5. I/O module transfers data.
Interrupt Processing

Figure 25:Interrupt Processing

1. A device driver initiates an I/O request on behalf of a process.


2. The device driver signals the I/O controller for the proper device, which initiates the requested
I/O.
3. The device signals the I/O controller that is ready to retrieve input, the output is complete or
that an error has been generated.
4. The CPU receives the interrupt signal on the interrupt-request line and transfer control over
the interrupt handler routine.
5. The interrupt handler determines the cause of the interrupt, performs the necessary processing
and executes a “return from” interrupt instruction.
6. The CPU returns to the execution state prior to the interrupt being signaled.
7. The CPU continues processing until the cycle begins again.
Direct Memory Access (DMA)
Different from Programmed I/O and Interrupt-Driven I/O, Direct Memory Access is a
technique for transferring data within main memory and external device without passing it
through the CPU.

It is a way to improve processor activity and I/O transfer rate by taking-over the job of
transferring data from the processor, and letting the processor do other tasks.

This technique overcomes the drawbacks of other two I/O techniques which are the time
consuming process when issuing command for data transfer and tie-up the processor in data
transfer while the data processing is neglected. It is more efficient to use the DMA method
when large volumes of data has to be transferred.

For DMA to be implemented, the processor has to share its‟ system bus with the DMA
module. Therefore, the DMA module must use the bus only when the processor does not need
it, or it must force the processor to suspend operation temporarily. The latter technique is more
common to be used and it is referred to as cycle stealing.

Figure 26:DMA and Interrupt Breakpoints during an Instruction Cycle

Basic Operation of DMA


When the processor wishes to read or send a block of data, it issues a command to the DMA
module by sending some information to the module. The information includes:
● Read or write command, sending through read and write control lines.
● Number of words to be read or written, communicated on the data lines and stored in the
data count register.
● Starting location in memory to read from or write to, communicated on data lines and
stored in the address register.
● Address of the I/O device involved, communicated on the data lines.

Figure 27:Typical DMA Block Diagram

After the information is sent, the processor continues with other work. The DMA module then
transfers the entire block of data directly to or from memory without going through the
processor. When the transfer is complete, the DMA module sends an interrupt signal to the
processor to inform that it has finished using the system bus.

Advantages & Disadvantages of DMA

Advantages Allows a peripheral device to read from/write to memory


without going through the CPU

Allows for faster processing since the processor can be working


on something else while the peripheral can be populating
memory

Disadvantages Requires a DMA controller to carry out the operation, which


increases the cost of the system
Cache coherence problems

Key I/O Specifications for a computer


 Keyboard – Layout, Language and ease of use.
 Mouse – Type (Wireless, wired)
 Monitor – Resolution, Size
 Printer – Speed (Pages per minutes), Colour or non-colour, resolution (dpi), type
(impact vs. non impact)

Further Reading
1. https://www.tutorialspoint.com/computer_fundamentals/computer_input_devices.htm
2. https://www.tutorialspoint.com/computer_fundamentals/computer_hardware.htm

Conclusion
At the end of this learning outcome, the learner should be able to explain and categorizing the
peripheral devices, explain Input/output (I/O) processing, explain the bus interface role in I/O
and different modes of data transfer. The learner should also able to prescribe I/O
specifications for a user and verify I/O specifications for a given computer.

6.3.5.3 Self-Assessment

Written Assessment
1. What is a peripheral device?
2. What is the purpose of the Bus Interface Unit?
3. Which specifications are important for a monitor?
4. How is an interrupt processed?
5. What type of devices are computer speakers or headphones?
a. Input
b. Input/output
c. Software
d. Output
Oral Assessment
1. Distinguish between programmed and Interrupt driven I/O.
2. How does DMA process I/O requests?
Practical Assessment
1. Verify the various I/O ports in your PC.
2. Confirm the specifications of the I/O devices attached to your computer.
6.3.5.4 Tools, Equipment, Supplies and Materials
● Computer
● Internet connectivity
● Stationery
● Instruction material
6.3.5.5 References

1. http://openbookproject.net/courses/intro2ict/hardware/peripherals.html
2. https://www.tutorialspoint.com/computer_fundamentals/computer_components.htm

2.3.6 Learning Outcome 5: Understand computer arithmetic and logic


2.3.6.1 Learning Activities
Learning Outcome 5: Understand computer arithmetic and logic
Learning Activities Special Instructions

5.1 Number systems are explained Activities may be carried out in


5.2 Integer and Floating point representations are groups or as individual
demonstrated according to IEEE standard
5.3 Integer and Floating point arithmetic is explained
5.4 Logic operators are explained
5.5 Logic operations are explained
5.6 Methods of representing logic operations are
demonstrated

2.3.6.2 Information Sheet No. 2/LO5: Understand computer arithmetic and logic

Introduction
This learning outcome involves explaining number systems, demonstrating Integer and
floating point representations according to IEEE standard, explaining integer and floating
point arithmetic, logic operators and logic operations and demonstrating methods of
representing logic operations.

The Number System


The technique to represent and work with numbers is called the number system.
We have different types of numbering systems. They include:
● Decimal number system
● The binary number system
● octal number system
● hexadecimal number system

Decimal Number System


Decimal number system is a base 10 number system having 10 digits from 0 to 9. This means
that any numerical quantity can be represented using these 10 digits. Decimal number system is
also a positional value system. This means that the value of digits will depend on its position.
Let us take an example to understand this.

Say we have three numbers – 734, 971 and 207. The value of 7 in all three numbers is different−
● In 734, value of 7 is 7 hundreds or 700 or 7 × 100 or 7 × 102
● In 971, value of 7 is 7 tens or 70 or 7 × 10 or 7 × 101
● In 207, value 0f 7 is 7 units or 7 or 7 × 1 or 7 × 100

The weightage of each position can be represented as follows –


Decimal Number System

Binary Number System


The easiest way to vary instructions through electric signals is the two-state system – on and
off. On is represented as 1 and off as 0, though 0 is not actually a no signal but signal at a lower
voltage.
The number system having just these two digits – 0 and 1 – is called binary number system.
Each binary digit is also called a bit. Binary number system is also a positional value system,
where each digit has a value expressed in powers of 2, as displayed here.

Binary Number System

In any binary number, the rightmost digit is called least significant bit (LSB) and leftmost digit
is called most significant bit (MSB).

Least significant bit (LSB) and most significant bit (MSB)


And the decimal equivalent of this number is the sum of the product of each digit with its
positional value.
110102 = 1×24 + 1×23 + 0×22 + 1×21 + 0×20
= 16 + 8 + 0 + 2 + 0
= 2610

Computer memory is measured in terms of how many bits it can store. Here is a chart for
memory capacity conversion.
● 1 byte (B) = 8 bits
● 1 Kilobytes (KB) = 1024 bytes
● 1 Megabyte (MB) = 1024 KB
● 1 Gigabyte (GB) = 1024 MB
● 1 Terabyte (TB) = 1024 GB
● 1 Exabyte (EB) = 1024 PB
● 1 Zettabyte = 1024 EB
● 1 Yottabyte (YB) = 1024 ZB

Octal Number System


Octal number system has eight digits – 0, 1, 2, 3, 4, 5, 6 and 7.
Octal number system is also a positional value system with where each digit has its value
expressed in powers of 8, as shown here –

Octal Number System

Decimal equivalent of any octal number is the sum of the product of each digit with its
positional value.
7268 = 7×82 + 2×81 + 6×80
= 448 + 16 + 6
= 47010

Hexadecimal Number System


Octal number system has 16 symbols – 0 to 9 and A to F where A is equal to 10, B is equal to
11 and so on till F. Hexadecimal number system is also a positional value system with where
each digit has its value expressed in powers of 16, as shown here –

Hexadecimal Number System


Decimal equivalent of any hexadecimal number is the sum of the product of each digit with its
positional value.
27FB16 = 2×163 + 7×162 + 15×161 + 10×160
= 8192 + 1792 + 240 +10
= 1023410

Number System Relationship


The following table depicts the relationship between decimal, binary, octal and hexadecimal
number systems.

Table 5: Number System Relationship

HEXADECIMAL DECIMAL OCTAL BINARY

0 0 0 0000

1 1 1 0001

2 2 2 0010

3 3 3 0011

A 10 12 1010

B 11 13 1011

C 12 14 1100

ASCII
Besides numerical data, computers must be able to handle alphabets, punctuation marks,
mathematical operators, special symbols, etc. that form the complete character set of English
language. The complete set of characters or symbols are called alphanumeric codes. The
complete alphanumeric code typically includes –
● 26 upper case letters
● 26 lower case letters
● 10 digits
● 7 punctuation marks
● 20 to 40 special characters

Now a computer understands only numeric values, whatever the number system used. So all
characters must have a numeric equivalent called the alphanumeric code. The most widely used
alphanumeric code is American Standard Code for Information Interchange (ASCII). ASCII is a
7-bit code that has 128 (27) possible codes.

Table 6: ASCII
Unicode
Unicode is an international coding system designed to be used with different language scripts.
Each character or symbol is assigned a unique numeric value, largely within the framework of
ASCII. Earlier, each script had its own encoding system, which could conflict with each other.

In contrast, this is what Unicode officially aims to do − Unicode provides a unique number for
every character, no matter what the platform, no matter what the program, no matter what the
language.

Number Systems Conversions

Decimal to Binary
Decimal numbers can be converted to binary by repeated division of the number by 2 while
recording the remainder.

Example:
The remainders are to be read from bottom to top to obtain the binary equivalent.
4310 = 1010112

Decimal to Octal
Decimal numbers can be converted to octal by repeated division of the number by 8 while
recording the remainder.

Example:

Reading the remainders from bottom to top,


47310 = 7318

Decimal to Hexadecimal
Decimal numbers can be converted to octal by repeated division of the number by 16 while
recording the remainder.

Example:

Reading the remainders from bottom to top we get,


42310 = 1A716

Binary to Octal and Vice Versa


To convert a binary number to octal number, these steps are followed −
● Starting from the least significant bit, make groups of three bits.
● If there are one or two bits less in making the groups, 0s can be added after the most
significant bit
● Convert each group into its equivalent octal number

Example:

101100101012 = 26258

To convert an octal number to binary, each octal digit is converted to its 3-bit binary equivalent
according to this table.

Example:
Octal Digit 0 1 2 3 4 5 6 7

Binary Equivalent 00 00 01 01 10 10 11 11
0 1 0 1 0 1 0 1
546738 = 1011001101110112

Binary to Hexadecimal
To convert a binary number to hexadecimal number, these steps are followed −
● Starting from the least significant bit, make groups of four bits.
● If there is one or two bits less in making the groups, 0s can be added after the most
significant bit.
● Convert each group into its equivalent octal number.

Example:
101101101012 = DB516
To convert an octal number to binary, each octal digit is converted to its 3-bit binary equivalent.

IEEE-based Integer and Floating point representations

Integers
An integer is a whole number (not a fraction) that can be positive, negative, or zero.
Therefore, the numbers 10, 0, -25, and 5,148 are all integers.

Integers are a commonly used data type in computer programming. For example, whenever a
number is being incremented, such as within a "for loop" or "while loop," an integer is used.
Integers are also used to determine an item's location within an array.

When two integers are added, subtracted, or multiplied, the result is also an integer. However,
when one integer is divided into another, the result may be an integer or a fraction. For
example, 6 divided by 3 equals 2, which is an integer, but 6 divided by 4 equals 1.5, which
contains a fraction. Decimal numbers may either be rounded or truncated to produce an integer
result.

Floating Point numbers


As the name implies, floating point numbers are numbers that contain floating decimal points.
For example, the numbers 5.5, 0.001, and -2,345.6789 are floating point numbers.

Computers recognize real numbers that contain fractions as floating point numbers. When a
calculation includes a floating point number, it is called a "floating point calculation." Older
computers used to have a separate floating point unit (FPU) that handled these calculations,
but now the FPU is typically built into the computer's CPU.

Floating point arithmetic


Arithmetic operations on floating point numbers consist of addition, subtraction,
multiplication and division the operations are done with algorithms similar to those used on
sign magnitude integers (because of the similarity of representation) -- example, only add
numbers of the same
sign. If the numbers are of the opposite sign, you must do subtraction.

Addition
Example on decimal value given in scientific notation:
3.25 x 10 ** 3
+ 2.63 x 10 ** -1
-----------------
First step: Align decimal points

Second step: add

3.25 x 10 ** 3
+ 0.000263 x 10 ** 3
--------------------
3.250263 x 10 ** 3
(Presumes use of infinite precision, without regard for accuracy)

Third step: normalize the result

Example on fl pt. value given in binary:


.25 = 0 01111101 00000000000000000000000
100 = 0 10000101 10010000000000000000000

To add these fl. pt. representations,


Step 1: Align radix points
Shifting the mantissa LEFT by 1 bit DECREASES THE EXPONENT by 1
Shifting the mantissa RIGHT by 1 bit INCREASES THE EXPONENT by 1

We want to shift the mantissa right, because the bits that fall off the end should come from
the least significant end of the mantissa
-> Choose to shift the .25, since we want to increase its exponent.
-> Shift by 10000101
-01111101
---------
00001000 (8) places.

0 01111101 00000000000000000000000 (original value)


0 01111110 10000000000000000000000 (shifted 1 place)
(note that hidden bit is shifted into msb of mantissa)
0 01111111 01000000000000000000000 (shifted 2 places)
0 10000000 00100000000000000000000 (shifted 3 places)
0 10000001 00010000000000000000000 (shifted 4 places)
0 10000010 00001000000000000000000 (shifted 5 places)
0 10000011 00000100000000000000000 (shifted 6 places)
0 10000100 00000010000000000000000 (shifted 7 places)
0 10000101 00000001000000000000000 (shifted 8 places)

Step 2: Add (don't forget the hidden bit for the 100)
0 10000101 1.10010000000000000000000 (100)
+ 0 10000101 0.00000001000000000000000 (.25)
---------------------------------------
0 10000101 1.10010001000000000000000
Step 3: normalize the result (get the "hidden bit" to be a 1)
It already is for this example.

The result is
0 10000101 10010001000000000000000

Subtraction
Like addition as far as alignment of radix points then the algorithm for subtraction of sign mag.
numbers takes over.

Before subtracting, compare magnitudes (don't forget the hidden bit!)


Change sign bit if order of operands is changed. Don't forget to normalize numbers afterward.

Multiplication
Example on decimal values given in scientific notation:
3.0 x 10 ** 1
+ 0.5 x 10 ** 2
-----------------

Algorithm: multiply mantissa, add exponents


3.0 x 10 ** 1
+ 0.5 x 10 ** 2
-----------------
1.50 x 10 ** 3
Example in binary: Use a mantissa that is only 4 bits so that you don‟t take long doing the
multiplication part.
0 10000100 0100
x 1 00111100 1100
-----------------
Mantissa multiplication: 1.0100
(don't forget hidden bit) x 1.1100
------
00000
00000
10100
10100
10100
---------
1000110000
becomes 10.00110000

Add exponents: Always add true exponents (otherwise the bias gets added in twice)

Biased:
10000100
+ 00111100
----------
10000100 01111111 (switch the order of the subtraction,
- 01111111 - 00111100 so that we can get a negative value)
---------- ----------
00000101 01000011
true exp true exp
is 5. is -67
Add true exponents 5 + (-67) is -62.
Re-bias exponent: -62 + 127 is 65.

Unsigned representation for 65 is 01000001.

Put the result back together (and add sign bit).


1 01000001 10.00110000

Normalize the result:


(Moving the radix point one place to the left increases the exponent by 1.)
1 01000001 10.00110000
becomes
1 01000010 1.000110000

This is the value stored (not the hidden bit!):


1 01000010 000110000

Division
 Similar to multiplication.
 True division: do unsigned division on the mantissas (don't forget the hidden bit)
 Subtract TRUE exponents

The IEEE standard is very specific about how all this is done. Unfortunately, the hardware
to do all this is very slow.

Some comparisons of approximate times:


2's complement integer add 1 time unit
fl. pt add 4 time units
fl. pt multiply 6 time units
fl. pt. divide 13 time units

There is a faster way to do division. It‟s called division by reciprocal approximation. It takes
about the same time as a fl. pt. multiply. Unfortunately, the results are not always the same as
with true division.

Division by reciprocal approximation:


Instead of doing a / b, they do a x 1/b.
Figure out a reciprocal for b, and then use the fl. pt.

Example of a result that isn't the same as with true division.


True division: 3/3 = 1 (exactly)
Reciprocal approx: 1/3 = .33333333

3 x .33333333 = .99999999, not 1

It is not always possible to get a perfectly accurate reciprocal.

Rounding
Arithmetic operations on fl. pt. values compute results that cannot be represented in the given
amount of precision. So, we must round results.

There are MANY ways of rounding. They each have "correct" uses, and exist for different
reasons. The goal in a computation is to have the computer round such that the end result is as
"correct" as possible.

Methods of rounding:
Round toward 0 -- also called truncation.
Figure out how many bits (digits) are available. Take that many bits (digits) for the result and
throw away the rest. This has the effect of making the value represented closer to 0.

Example:
.7783 If 3 decimal places available, .778
If 2 decimal places available, .77

Round toward + infinity -- regardless of the value, round towards +infinity.

Example:
1.23 If 2 decimal places, 1.3
-2.86 if 2 decimal places, -2.8

Round toward - infinity -- regardless of the value, round towards -infinity.

Example:
1.23 If 2 decimal places, 1.2
-2.86 if 2 decimal places, -2.9

In binary -- rounding to 2 digits after radix point


Round toward + infinity --
1.1101
|
1.11 | 10.00
------
1.001
|
1.00 | 1.01
-----

Round toward - infinity --


1.1101
|
1.11 | 10.00
------
1.001
|
1.00 | 1.01
-----
Round toward zero (TRUNCATE) --
1.1101
|
1.11 | 10.00
------
1.001
|
1.00 | 1.01
-----
-1.1101
|
-10.00 | -1.11
------
-1.001
|
-1.01 | -1.00
-----
Round toward nearest --

ODD CASE:
If there is anything other than 1000 to the right of the number of digits to be kept, it is
rounded in IEEE standard such that the least significant bit (to be kept) is a zero.

1.1111
|
1.11 | 10.00
------
1.1101
|
1.11 | 10.00
------
1.001 (ODD CASE)
|
1.00 | 1.01
-----
-1.1101 (1/4 of the way between)
|
-10.00 | -1.11
------
-1.001 (ODD CASE)
|
-1.01 | -1.00
-----
Integer Representation and Arithmetic

Integer Representation
● Bit-- Binary Digit
○ 1 byte = 8 bits
○ 1 word = 2 bytes
● Integer takes up two bytes; can be signed or unsigned.

Unsigned Integers
● Can represent whole numbers from 0 to 65,535
○ (0 to 216 - 1).
● In binary, this is from
○ 02to 11111111111111112
● Internally, binary representation of decimal value is 16 bits.

Signed Integers
● Need to reserve one bit for the sign.
● Three ways:
○ Sign-Magnitude
○ 1's Complement
○ 2's Complement
Sign-Magnitude
● Uses the most significant bit of the word to represent the sign.
○ 0 - Positive
○ 1 - Negative.
● Rest of the number is encoded in magnitude part
37 = 00000000 00100101
-37 = 10000000 00100101
6712 = 00011010 00111000
-6712 = 10011010 00111000
● Can represent numbers from -32,767 to 32,767.
○ -215+1 .. 215-1
● But, two representations for zero:
0 = 00000000 00000000
● -0 = 10000000 00000000 Arithmetic can be cumbersome.

1's Complement
● Negative numbers are stored as bitwise complement of corresponding positive numbers.
● Leftmost bit of the positive number is 0. That of the negative number is 1.
196 = 00000000 11000100
-196 = 11111111 00111011
● Can represent numbers from -32,767 to 32,767.
○ -215+1 .. 215-1
● Arithmetic is easier than sign-magnitude.
● But, still have two representations for zero:
0 = 00000000 00000000
-0 = 11111111 11111111

2's Complement
● Modern Method: Positive number represented in same way as other two methods
● Negative number obtained by taking 1's Complement of positive number and adding 1.
6713 = 00011000 00011101
1's Comp = 11100111 11100010
2's Comp = 11100111 11100011
● Word integers can represent numbers from -32,768 to 32,767.
○ -215 .. 215-1
● Byte integers can represent numbers from -128 to 127.
○ -27 .. 27-1
● One version of zero:
00000000 00000000

Conversion of Byte Integer to Word


● Sign Extension
● Copy sign bit of the byte into all the bits of the upper byte of the word.
37 = 00100101 -> 00000000 00100101
● -37 = 11011011 -> 11111111 11011011 cbw
○ converts the signed byte in AL to a word in AX
Conversion of Word Integer to Byte
● Remove the upper byte of the word. Retain only the lower byte.
● Meaningful only if the original number can be represented by a byte.

Integer Arithmetic (1's Comp and 2's Comp)


● Addition: Simply add the two binary representations.
● Subtraction: Find negative of one number, add to the second.

Addition in 1's Comp


● Add binary representations of the two numbers.
● If there is a carry, add it back in on the right side.
51 00110011
+ (-37) + 11011010
----------
1 00001101
+1
----------
14 00001110

Addition in 2's Comp


● Add binary representations of the two numbers.
● Disregard the carry.
51 00110011
+ (-37) + 11011011
----------
14 1 00001110

Subtraction in 2's Comp


Overflow
● If two numbers have different signs, their sum will never overflow.
● If they have the same sign, they might overflow.
● Overflow has occurred if sign of result is different than sign of addends.

Logic operators and Logic Operations


A logical operator is a special symbol or word that connects two or more phrases of
information.

We have a range of the logic operators which include OR, AND, NOT, NOR, XOR and
XNOR.
OR
The OR logic operation returns True if either its inputs are True. If all inputs are false, the
output is also false. In computer programming, the OR operation is usually written as || (two
vertical bars). In Boolean algebra, the OR value of two inputs A and B can be written as A+B.

Note Do not mistake the OR operation for arithmetic addition, even though they both use the
"+" symbol. They are distinct operations.

Below is the circuit diagram of an OR logic gate.

OR logic gate

AND
The AND logic operation returns True only if either of its inputs are True. If either of the
inputs is False the output is also false. In computer programming, the AND operation is
usually written as && (two ampersands). In Boolean algebra, the AND operation of two
inputs A and B can be written as AB.

Below is the circuit diagram of an AND logic gate.

OR logic gate

NOT
The NOT logic operation returns True if its input is False, and False if its input is True. In
computer programming, the NOT operation is usually written as ! (an exclamation mark). In
Boolean algebra, the NOT value of an input A can be written as (A with an overscore).

Below is the circuit diagram of a NOT logic gate.

NOT logic gate


NOR
The NOR logic operation “stands for NOT OR” returns true if either of its inputs are false, and
false if either of its inputs are true. In Boolean algebra, the NOR value of two inputs A and B
can be written as (A+B with an overscore). NOR has the distinction of being one of two
"universal" logic gates, because any other logic operation can be created using only NOR
gates. (The other universal logic gate is NAND.)

Below is the circuit diagram of a NOR logic gate.

NOR logic gate

XOR
The XOR logic operation (which stands for "Exclusive OR" returns true if either of its inputs
differ, and false if they are all the same. In other words, if its inputs are a combination of true
and false, the output of XOR is true. If its inputs are all true or all false, the output of XOR is
false. In Boolean algebra, the XOR value of two inputs A and B can be written as A⊕B (the
XOR symbol, resembles a plus sign inside a circle).

Below is the XOR operation circuit diagram.

Exclusive OR gate

XNOR
The XNOR logic operation (which stands for "Exclusive NOT OR" returns true if either of its
inputs are the same, and false if either of them differ. In other words, if its inputs are a
combination of true and false, the output of XNOR is false. If its inputs are all true or all false,
the output of XNOR is true. In Boolean algebra, the XNOR value of two inputs A and B can
be written as (the XOR symbol ⊕, resembles a plus sign inside a circle with a line over
everything).
Below is the XNOR operation circuit diagram.

Exclusive NOT OR gate

Karnaugh map
A Karnaugh map provides a pictorial method of grouping together expressions with common
factors and therefore eliminating unwanted variables. The Karnaugh map can also be described
as a special arrangement of a truth table.

The diagram below illustrates the correspondence between the Karnaugh map and the truth
table for the general case of a two variable problem.

The values inside the squares are copied from the output column of the truth table, therefore
there is one square in the map for every row in the truth table. Around the edge of the
Karnaugh map are the values of the two input variable. A is along the top and B is down the
left hand side. The diagram below explains this:
The values around the edge of the map can be thought of as coordinates. So as an example, the
square on the top right hand corner of the map in the above diagram has coordinates A=1 and
B=0. This square corresponds to the row in the truth table where A=1 and B=0 and F=1. Note
that the value in the F column represents a particular function to which the Karnaugh map
corresponds.

Conclusion
At the end of this learning outcome, the learner should be able to explain number systems,
demonstrate integer and floating point representations according to IEEE standard explain
integer and floating point arithmetic, logic operators and logic operations and demonstrate
methods of representing logic operations.

Further Reading
1. https://www.tutorialspoint.com/fixed-point-and-floating-point-number-representations
2. https://www.tutorialspoint.com/computer_logical_organization/boolean_algebra.htm

2.3.6.3 Self-Assessment

Written Assessment
1. Which of the following is not a logical operator?
a. And
b. OR
c. Else
d. NOT

2. Boolean operator which combines search terms so that each search result contains all of
terms, is
a. and operator
b. not operator
c. or operator
d. nor operator
3. The sign magnitude representation of -1 is?
a. 1001
b. 1000
c. 0001
d. 1110
4. The ALU gives the output of the operations and the output is stored in the?
a. Memory devices
b. Registers
c. Flags
d. Output Unit
5. The bitwise complement of 0 is?
a. 00000001
b. 11111111
c. 11111110
d. 10000000

Oral Assessment
1. Describe the logical operators
2. Describe with illustrations how to convert Decimal to binary
Practical Assessment
Research on the application areas of logic operations in computer science.

2.3.6.4 Tools, Equipment, Supplies and Materials


● Computer
● Internet connectivity
● Calculator
● Stationery
● Instruction material

2.3.2.5 References

1. http://mathworld.wolfram.com/KarnaughMap.html
2. https://www.tutorialspoint.com/computer_logical_organization/boolean_algebra.htm
3. https://www.tutorialspoint.com/digital_circuits/digital_circuits_boolean_algebra.htm

You might also like