Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Problem 1: Consider two Processor A and B.

Processor A has clock speed


3.2GHz and B has 2.00GHz. Which processor is faster? How much?
Solution:
Processor A can executes 3.2*109 instructions in 1 seconds
1
So, 1 instruction can be executed in = 0.0000000003125 seconds
3.2 ∗ 109
1
Similarly, for processor B time for executing 1 instruction is = 0.0000000005
2 ∗ 109
seconds
So execution time of processor A < execution time of Processor B
0.0000000005
Therefore, processor A is faster than B and by = 1.6 time
0.0000000003125

As we know, The CPU is the brain of the computer, the place where data is manipulated. In large
computer systems, such as supercomputers and mainframes, processing tasks may be handled by
multiple processing chips. In the average microcomputer, the entire CPU is single unit, called a
microprocessor. Every CPU has at least two basic parts: (i) the control unit and (ii) the arithmetic
logic unit (ALU).
The control unit: All the computer’s resources are managed from the control unit. It is like a
traffic signal directing the flow of data through the CPU, as well as to and from other devices. The
control unit is the logical hub of the computer. The CPU’s instructions for carrying out commands
are built into the control unit. The instructions, or instruction set, list all the operations that the
CPU can perform. Each instruction in the instruction set is expressed in microcode- a set of basic
directions that tell the CPU how to execute more complex operations.
The Arithmetic Logic Unit (ALU): Because all computer data stored as numbers, much of the
processing that takes place involves comparing number or carrying out mathematical operation.
These mathematical operations are performed in ALU. The computer can perform two types of
operation: arithmetic operation and logical operations. Arithmetic operations include addition,
subtraction, multiplication, and division. Logical operations include comparisons, such as
determining one number is equal to, greater than, or less than another number. The ALU includes
a group of registers- high speed memory locations built directly into the CPU that are used to hold
the data currently being processed.
Computer Memory
Although many types of memory in a computer exist, the most basic distinction is between primary
memory, often called system memory, secondary memory, which is more commonly called storage
and cache memory, which used to store frequently used instruction for speed up the execution
process.
Primary memory includes ROM and RAM, and is located close to the CPU on the computer
motherboard, enabling the CPU to read data from primary memory very quickly indeed. It is used
to store data that the CPU needs imminently so that it does not have to wait for it to be delivered.
Secondary memory by contrast, is usually physically located within a separate storage device,
such as a hard disk drive or solid state drive (SSD), which is connected to the computer system
either directly or over a network. The cost per gigabyte of secondary memory is much lower, but
the read and write speeds are significantly slower.
Cache memory is a 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.

Types of Primary Memory


There are two key types of primary memory:
 RAM, or random access memory
 ROM, or read-only memory

 RAM, Main memory of computer


The acronym RAM stems from the fact that data stored in random access memory can be accessed
– as the name suggests – in any random order. Alternatively, put another way, any random bit of
data can be accessed just as quickly as any other bit.
The most important things to understand about RAM are that RAM memory is very fast, it can be
written to as well as read, it is volatile (so all data stored in RAM memory is lost when it loses
power) and, finally, it is very expensive compared to all types of secondary memory in terms of
cost per gigabyte. It is because of the relative high cost of RAM compared to secondary memory
types that most computer systems use both primary and secondary memory.
Data that is required for imminent processing is moved to RAM where it can be accessed and
modified very quickly, so that the CPU is not kept waiting. When the data is no longer required it
is shunted out to slower but cheaper secondary memory, and the RAM space that has been freed
up is filled with the next chunk of data that is about to be used.
 ROM
ROM stands for read-only memory, and the name stems from the fact that while data can be read
from this type of computer memory, data cannot normally be written to it. It is a very fast type of
computer memory, which is usually installed close to the CPU on the motherboard.
ROM is a type of non-volatile memory, which means that the data stored in ROM persists in the
memory even when it receives no power – for example, when the computer is turned off. In that
sense, it is similar to secondary memory, which is used for long-term storage.
When a computer is turned on, the CPU can begin reading information stored in ROM without the
need for drivers or other complex software to help it communicate. The ROM usually contains
"bootstrap code" which is the basic set of instructions a computer needs to carry out to become
aware of the operating system stored in secondary memory, and to load parts of the operating
system into primary memory so that it can start up and become ready to use.
ROM is also used in simpler electronic devices to store firmware, which runs as soon as the device
is switched on.

Register
Size Cache Price
and
Ram speed

Hard disk

Types of ROM
ROM is available in several different types, including PROM, EPROM, and EEPROM.

 PROM PROM stands for Programmable Read-Only Memory, and it is different from true
ROM in that while a ROM is programmed (i.e. has data written to it) during the
manufacturing process, a PROM is manufactured in an empty state and then programmed
later using a PROM programmer or burner.
 EPROM EPROM stands for Erasable Programmable Read-Only Memory, and as the name
suggests, data stored in an EPROM can be erased and the EPROM reprogrammed. Erasing
an EPROM involves removing it from the computer and exposing it to ultraviolet light
before re-burning it.
 EEPROM EEPROM stands for Electrically Erasable Programmable Read-Only Memory,
and the distinction between EPROM and EEPROM is that the latter can be erased and
written to by the computer system it is installed in. In that sense EEPROM is not strictly
read-only. However in many cases the write process is slow, so it is normally only done to
update program code such as firmware or BIOS code on an occasional basis.

Differences between RAM and ROM


ROM:
 Non-volatile
 Fast to read
 Usually used in small quantities
 Cannot be written to quickly
 Used to store boot instructions or firmware
 Relatively expensive per megabyte stored compared to RAM
RAM:
 Volatile
 Fast to read and write
 Used as system memory to store data (including program code) that the CPU needs to
process imminently
 Relatively cheap per megabyte stored compared to ROM, but relatively expensive
compared to secondary 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. CPU directly does not 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, SSD etc.
How the CPU Executes Program Instructions
Let us examine the way the central processing unit, in association with memory, executes a
computer program. We will be looking at how just one instruction in the program is executed. In
fact, most computers today can execute only one instruction at a time, though they execute it very
quickly. Many personal computers can execute instructions in less than one-millionth of a second,
whereas those speed demons known as supercomputers can execute instructions in less than one-
billionth of a second.

Control Unit Arithmetic logic


unit
Cache
2. Decode
3. Execute Processor
1. Fetch
4. Store

Computer Memory (RAM)

Secondary Storage (hard Disk)

Before an instruction can be executed, program instructions and data must be placed into memory
from an input device or a secondary storage device (the process is further complicated by the fact
that, as we noted earlier, the data will probably make a temporary stop in a register). As Figure 2
shows, once the necessary data and instruction are in memory, the central processing unit performs
the following four steps for each instruction:
1. The control unit fetches (gets) the instruction from memory.
2. The control unit decodes the instruction (decides what it means) and directs that the
necessary data be moved from memory to the arithmetic/logic unit. These first two steps
together are called instruction time, or I-time.
3. The arithmetic/logic unit executes the arithmetic or logical instruction. That is, the ALU is
given control and performs the actual operation on the data.
4. Thc arithmetic/logic unit stores the result of this operation in memory or in a register. Steps
3 and 4 together are called execution time, or E-time. The control unit eventually directs
memory to release the result to an output device or a secondary storage device. The
combination of I-time and E-time is called the machine cycle.

You might also like