KEMBAR78
Computer Architecture | PDF | Computer Data Storage | Central Processing Unit
0% found this document useful (0 votes)
13 views27 pages

Computer Architecture

Uploaded by

nnemalvis2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views27 pages

Computer Architecture

Uploaded by

nnemalvis2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

Central Processing Unit (CPU)

The Central Processing Unit (CPU) is like the brain of a computer. It’s the part that does most of
the thinking, calculating, and decision-making to make your computer work. Whether you’re playing
a game, typing a school assignment, or watching a video, the CPU is busy handling all the
instructions to get the job done.

The CPU is usually placed in a special slot called a socket on the computer’s motherboard, which is
like the main circuit board that connects all the parts of a computer. The CPU handles tasks like:

 Doing math calculations (like adding or multiplying numbers).

 Running apps or games.

 Helping the keyboard, mouse, and screen work together.

 Storing and retrieving information during tasks.

Without a CPU, a computer wouldn’t know what to do.

Why CPU is Important in Computing

The CPU is super important because it handles every task your computer does. Without it, your
computer would just be a fancy box! A fast CPU means your games run smoothly, your apps open
quickly, and your homework gets done faster.

History of CPU

The story of the CPU started long ago and has some exciting milestones that changed how computers
work. Here’s a simple timeline for students:

 1823: A scientist named Baron Jons Jakob Berzelius discovered silicon, a material still used
to make CPUs today.

 1947: Scientists John Bardeen, Walter Brattain, and William Shockley invented
the transistor, a tiny switch that helped make modern CPUs possible.
 1958: Engineers Jack Kilby and Robert Noyce created the integrated circuit, which
combined many transistors into a single chip.

 1971: Intel released the Intel 4004, the first-ever microprocessor (a CPU on a single chip),
starting the era of personal computers.

 1979: Motorola introduced the Motorola 68000, a powerful CPU used in early computers and
gaming consoles.

 1999: Intel launched the Celeron processors, making computers faster and more affordable.

 2005: AMD introduced the first dual-core processor, allowing CPUs to handle multiple tasks
at once.

 2009: Intel released the Core i5, a four-core processor that made computers even faster.

 2017-2018: Intel introduced the Core i9, one of the most powerful CPUs for desktops and
laptops.

Each step made CPUs smaller, faster, and more powerful, helping computers do more amazing
things!

Components of CPU

The components of a CPU include the ALU (Arithmetic Logic Unit), CU (Control Unit), registers,
cache, and clock.

2
The red lines show how data moves between the parts, while the blue lines show how the CPU sends
control signals to manage everything.

 Control Unit (CU): It controls the CPU's operations by reading and following instructions. It
also manages the flow of data inside the CPU.

 ALU (Arithmetic Logic Unit): It does all the math and logic calculations, like addition,
subtraction, and comparisons (such as checking if two numbers are equal).

 Input Unit: This part gets data from devices like a keyboard, mouse, or microphone, and
sends it to the CPU to be processed.

 Output Unit: After the CPU processes the data, the output unit sends it to devices like a
monitor, printer, or speakers so the user can see or hear the result.

 Internal Memory: This stores temporary data and instructions that the CPU needs while it’s
working, like the registers and cache memory.

 Main Memory: It holds the data and instructions the CPU is currently using, often in RAM
(Random Access Memory).

 Secondary Storage: This is where data and programs are stored when they’re not being used
right away, like on hard drives or SSDs.

Functions of the CPU

The CPU’s main job is to process instructions from programs. It does this through a process called
the Fetch-Decode-Execute-Store cycle:

This cycle happens billions of times a second, letting the CPU handle tons of tasks super fast!
3
 Fetch: the first CPU gets the instruction. That means binary numbers that are passed from
RAM to CPU.

 Decode: When the instruction is entered into the CPU, it needs to decode the instructions.
with the help of ALU(Arithmetic Logic Unit), the process of decoding begins.

 Execute: After the decode step the instructions are ready to execute.

 Store: After the execute step the instructions are ready to store in the memory.

Types of CPUs

CPUs come in different types, depending on how many cores they have. A core is like a mini-CPU
inside the main CPU, and more cores mean the CPU can do more tasks at once. Here are the main
types:

 Single-Core CPU: The oldest type, used in the 1970s. It can only handle one task at a time,
so it’s slow for modern apps like games or web browsers.

 Dual-Core CPU: Has two cores, so it can handle two tasks at once. It’s faster and better for
multitasking, like listening to music while doing homework.

 Quad-Core CPU: Has four cores, making it great for heavy tasks like video editing or
playing modern games. It’s very fast and common in today’s computers.

Why is the CPU Called the Brain of the Computer?

The CPU earns its nickname as the “brain” because it’s responsible for thinking through and
executing every task in a computer. Just like your brain processes information to make decisions, the
CPU processes instructions to make your computer do what you want. Without a CPU, a computer
would just be a lifeless box of parts.

How Does the CPU Make Computers Faster?

Modern CPUs are designed to be super efficient. Here are a few ways they speed things up:

 Multiple Cores: Many CPUs have multiple cores, which are like mini-CPUs that can work
on different tasks at the same time. It’s like having several chefs in the kitchen instead of one.

 Faster Clocks: The clock speed (measured in GHz, like 3.5 GHz) determines how many
instructions the CPU can handle per second.

4
 Bigger Cache: More cache means the CPU can store more data close by, reducing wait times.

 Pipelining: This lets the CPU start working on the next instruction before finishing the
current one, like a factory line.

Advantages of CPUs

 Versatile: CPUs can handle all kinds of tasks, from simple math to running complex games.

 Fast: Modern CPUs process billions of instructions per second.

 Multi-tasking: Multi-core CPUs let you run many programs at once, like watching a video
while chatting with friends.

 Compatible: CPUs work with tons of software, so you can use the same CPU for different
apps.

Disadvantages of CPUs

 Heat: CPUs get hot when working hard, so computers need fans or cooling systems to stay
safe.

 Power Use: Powerful CPUs use a lot of electricity, which can raise power bills.

 Cost: High-performance CPUs, like Intel Core i9, can be expensive.

 Not Perfect for All Tasks: For tasks like graphics or video editing, specialized chips
like GPUs (Graphics Processing Units) are better than CPUs.

Modern Applications

CPUs are everywhere, not just in computers:

CPU in Personal Computers: In your laptop or desktop, the CPU runs your games, apps, and
homework programs, making sure everything works smoothly.

Role in Mobile Devices: Your phone or tablet has a CPU too! It’s smaller and uses less power but
still handles calls, apps, and videos.

Use in Servers and Data Centers: In big data centers, CPUs power websites like YouTube and
Google, processing millions of requests every second.

5
Conclusion

The CPU is the brain of every computer, making it possible to play, learn, and connect. From its tiny
components to its super-fast cycles, the CPU is a marvel of technology. In the future, CPUs will get
even faster, smaller, and more efficient, powering cool new gadgets we can’t even imagine yet. So
next time you use your computer or phone, give a shout-out to the amazing CPU working hard
behind the scenes!

Instruction Formats (Zero, One, Two and Three Address Instruction)

Instruction formats refer to the way instructions are encoded and represented in machine language.
There are several types of instruction formats, including zero, one, two, and three-address
instructions.

Each type of instruction format has its own advantages and disadvantages in terms of code size,
execution time, and flexibility. Modern computer architectures typically use a combination of these
formats to provide a balance between simplicity and power.

Different Types of Instruction Fields

A computer performs a task based on the instructions provided. Instructions in computers are
comprised of groups called fields. These fields contain different information for computers which are
all written in 0s and 1s. Each field has a different significance or meaning, based on which a CPU
decides what to perform. The most common fields are:

 The operation field specifies the operation to be performed, like addition.

 Address field which contains the location of the operand, i.e., register or memory location.

 Mode field which specifies how operand is to be founded.

An instruction is of variable length depending upon the number of addresses it contains. Generally,
CPU organization is of three types based on the number of address fields:

 Single Accumulator organization: In this, the operation is performed using a special register
called the accumulator.

 General register organization : In Register Organization, multiple registers are used for the
computation purpose.

6
 Stack organization: In the third organization, the work on stack basis operation due to which it
does not contain any address field.

Types of Instructions

Based on the number of addresses, instructions are classified as:

NOTE: We will use the X = (A+B)*(C+D) expression to showcase the procedure.

Zero Address Instructions

These instructions do not specify any operands or addresses. Instead, they operate on data stored in
registers or memory locations implicitly defined by the instruction. For example, a zero-address
instruction might simply add the contents of two registers together without specifying the register
names.

Zero Address Instruction

A stack-based computer does not use the address field in the instruction. To evaluate an expression, it
is first converted to reverse Polish Notation i.e. Postfix Notation.

Expression: X = (A+B)*(C+D)
Postfixed : X = AB+CD+*
TOP means top of stack
M[X] is any memory location

7
Operatio
n Instruction Stack (TOP Value After Execution)

Push A PUSH A TOP = A

Push B PUSH B TOP = B

Add ADD TOP = A + B

Push C PUSH C TOP = C

Push D PUSH D TOP = D

Add ADD TOP = C + D

Multiply MUL TOP = (C + D) * (A + B)

Pop X POP X M[X] = TOP

One Address Instructions

These instructions specify one operand or address, which typically refers to a memory location or
register. The instruction operates on the contents of that operand, and the result may be stored in the
same or a different location. For example, a one-address instruction might load the contents of a
memory location into a register.

This uses an implied ACCUMULATOR register for data manipulation. One operand is in the
accumulator and the other is in the register or memory location. Implied means that the CPU already
knows that one operand is in the accumulator so there is no need to specify it.

8
One Address Instruction

Expression: X = (A+B)*(C+D)
AC is accumulator
M[] is any memory location
M[T] is temporary location

Operation Instruction Stack / Register (AC / M[])

Load A AC = A AC = A

Add B AC = AC + B AC = A + B

Store M[T] M[T] = AC M[T] = A + B

Load C AC = C AC = C

Add D AC = AC + D AC = C + D

Store M[] M[] = AC M[] = C + D

Multiply M[T] AC = AC * M[T] AC = (A + B) * (C + D)

Store X M[X] = AC M[X] = (A + B) * (C + D)

9
Two Address Instructions

These instructions specify two operands or addresses, which may be memory locations or registers.
The instruction operates on the contents of both operands, and the result may be stored in the same or
a different location. For example, a two-address instruction might add the contents of two registers
together and store the result in one of the registers.

This is common in commercial computers. Here two addresses can be specified in the instruction.
Unlike earlier in one address instruction, the result was stored in the accumulator, here the result can
be stored at different locations rather than just accumulators, but require more number of bit to
represent the address.

Two Address Instruction

Here destination address can also contain an operand.

Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[] is any memory location

Operation Instruction Registers / Memory (R1, R2, M[])

Load A R1 = A R1 = A

Add B R1 = R1 + B R1 = A + B

Store M[T] M[T] = R1 M[T] = A + B

Load C R2 = C R2 = C

10
Operation Instruction Registers / Memory (R1, R2, M[])

Add D R2 = R2 + D R2 = C + D

Store M[] M[] = R2 M[] = C + D

Multiply
R1 = R1 * M[T] R1 = (A + B) * (C + D)
M[T]

Store X M[X] = R1 M[X] = (A + B) * (C + D)

Three Address Instructions

These instructions specify three operands or addresses, which may be memory locations or registers.
The instruction operates on the contents of all three operands, and the result may be stored in the
same or a different location. For example, a three-address instruction might multiply the contents of
two registers together and add the contents of a third register, storing the result in a fourth register.

This has three address fields to specify a register or a memory location. Programs created are much
short in size but number of bits per instruction increases. These instructions make the creation of the
program much easier but it does not mean that program will run much faster because now
instructions only contain more information but each micro-operation (changing the content of the
register, loading address in the address bus etc.) will be performed in one cycle only.

Three Address Instruction

Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[] is any memory location

11
Operation Instruction Registers / Memory (R1, R2, M[])

Load A R1 = A R1 = A

Add B R1 = R1 + B R1 = A + B

Store M[T] M[T] = R1 M[T] = A + B

Load C R2 = C R2 = C

Add D R2 = R2 + D R2 = C + D

Store M[] M[] = R2 M[] = C + D

Multiply M[T] R1 = R1 * M[T] R1 = (A + B) * (C + D)

Store X M[X] = R1 M[X] = (A + B) * (C + D)

Advantages of Zero-Address, One-Address, Two-Address and Three-Address Instructions

Zero-address instructions

 Stack-based Operations: In stack-based architectures, where operations implicitly employ


the top items of the stack, zero-address instructions are commonly used.

 Reduced Instruction Set: It reduces the complexity of the CPU design by streamlining the
instruction set, which may boost reliability.

 Less Decoding Complexity: Especially helpful for recursive or nested processes, which are
frequently used in function calls and mathematical computations.

 Efficient in Nested Operations: Less bits are required to specify operands, which simplifies
the logic involved in decoding instructions.

12
 Compiler Optimization: Because stacks are based on stacks, several algorithms can take use
of this to improve the order of operations.

One-address instructions

 Intermediate Complexity: Strikes a balance between versatility and simplicity, making it


more adaptable than zero-address instructions yet simpler to implement than multi-address
instructions.

 Reduced Operand Handling: Compared to multi-address instructions, operand fetching is


made simpler by just needing to handle a single explicit operand.

 Implicit Accumulator: O ften makes use of an implicit accumulator register, which can
expedite up some operations' execution and simplify designs in other situations.

 Code Density: S maller code in comparison to two- and three-address instructions, which
may result in more efficient use of memory and the instruction cache.

 Efficient Use of Addressing Modes: Can make use of different addressing modes (such
indexed, direct, and indirect) to improve flexibility without adding a lot of complexity.

Two-address instructions

 Improved Efficiency: Allows for the execution of operations directly on memory or


registers, which reduces the amount of instructions required for certain activities.

 Flexible Operand Use: Increases programming variety by offering more options for operand
selection and addressing modes.

 Intermediate Data Storage: May directly store interim results, increasing some algorithms'
and calculations' efficiency.

 Enhanced Code Readability: Produces code that is frequently easier to read and
comprehend than one-address instructions, which is beneficial for maintenance and
troubleshooting.

 Better Performance: Better overall performance can result from these instructions because
they minimize the amount of memory accesses required for certain processes.

Three-address instructions

 Direct Representation of Expressions: Reduces the need for temporary variables and extra
instructions by enabling the direct representation of complicated expressions.

13
 Parallelism: Allows for the simultaneous fetching and processing of several operands, which
facilitates parallelism in CPU architecture.

 Compiler Optimization: Makes it possible for more complex compiler optimizations to be


implemented, which improve execution efficiency by scheduling and reordering instructions.

 Reduced Instruction Count: May increase execution performance even with bigger
instruction sizes by perhaps lowering the overall number of instructions required for
complicated processes.

 Improved Pipeline Utilization: More information in each instruction allows CPU pipelines
to be used more efficiently, increasing throughput overall.

 Better Register Allocation: Permits direct manipulation of several registers inside a single
instruction, enabling more effective usage of registers.

Disadvantages of Zero-Address, One-Address, Two-Address and Three-Address Instructions

Zero-address instructions

 Stack Dependency: In contrast to register-based architectures, zero-address instructions


might result in inefficiencies when it comes to operand access because of their heavy reliance
on the stack.

 Overhead of Stack Operations: Performance might be negatively impacted by the frequent


push and pop actions needed to maintain the stack.

 Limited Addressing Capability: The processing of intricate data structures may become
more difficult since they do not directly support accessing memory regions or registers.

 Difficult to Optimize: Because operand access is implied in stack-based designs, code


optimization might be more difficult.

 Harder to Debug: When compared to register-based operations, stack-based operations


might be less obvious and more difficult to debug.

One-address instructions

 Accumulator Bottleneck: Often uses an accumulator, which can act as a bottleneck and
reduce efficiency and parallelism.

 Increased Instruction Count: Multiple instructions may be needed for complex processes,
which would increase the overall number of instructions and code size.

14
 Less Efficient Operand Access: There is just one operand that is specifically addressed,
which might result in inefficient access patterns and extra data management instructions.

 Complex Addressing Modes: The instruction set and decoding procedure get more
complicated when several addressing modes are supported.

 Data Movement Overhead: Moving data between memory and the accumulator could need
more instructions, which would increase overhead.

Two-address instructions

 Operand Overwriting: Usually, the result overwrites one of the source operands, which
might lead to an increase in the number of instructions needed to maintain data.

 Larger Instruction Size: Because two-address instructions are bigger than zero- and one-
address instructions, the memory footprint may be increased.

 Intermediate Results Handling: It is frequently necessary to handle intermediate outcomes


carefully, which can make programming more difficult and result in inefficiencies.

 Decoding Complexity: The design and performance of the CPU may be impacted by the
greater complexity involved in decoding two addresses.

 Inefficient for Some Operations: The two-address style could still be inefficient for some
tasks, needing more instructions to get the desired outcome.

Three-address instructions

 Largest Instruction Size: Has the highest memory requirements per instruction, which can
put strain on the instruction cache and increase code size.

 Complex Instruction Decoding: Three addresses to decode adds complexity to the CPU
architecture, which might affect power consumption and performance.

 Increased Operand Fetch Time: Each instruction may execute more slowly if obtaining
three operands takes a long period.

 Higher Hardware Requirements: Has the potential to raise cost and power consumption
since it requires more advanced hardware to handle the higher operand handling and
addressing capabilities.

 Power Consumption: Higher power consumption is a crucial factor for devices that run on
batteries since it can be caused by more complicated instructions and increased memory
utilization.

15
Overall, the choice of instruction format depends on the specific requirements of the computer
architecture and the trade-offs between code size, execution time, and flexibility.

Note: The fastest IR is zero-address instructions after that three, then two and at last one-address
instructions because time taken in memory reference access has to do a lot with the length of an IR.

Introduction to memory and memory units

Memory is required to save data and instructions. Memory is divided into cells, and they are stored in
the storage space present in the computer. Every cell has its unique location/address. Memory is very
essential for a computer as this is the way it becomes somewhat more similar to a human brain. In
this article, we are going to discuss memory and memory units in detail.

What is Memory?

Memory devices are digital systems that store data either temporarily or for a long term. Digital
computers to hard disks have built-in memory devices that can store the data of users or
manufacturers. The data either be in the form of control programs or programs that boot the system.
Hence, to store such a huge amount of data the memory devices must have enormous capacity. The
challenge is to build memory devices that have large capacities but are cost-effective. The memory
devices must be capable of storing both permanent data and instantaneous data.

Memories are made up of registers. Each register in the memory is one storage location. The storage
location is also called a memory location. Memory locations are identified using Address. The total
number of bits a memory can store is its capacity. A storage element is called a Cell. Each register is
made up of a storage element in which one bit of data is stored.

The data in a memory are stored and retrieved by the process called writing and reading respectively.

16
 A word is a group of bits where a memory unit stores binary information. A word with a
group of 8 bits is called a byte.

 A memory unit consists of data lines, address selection lines, and control lines that specify the
direction of transfer.

The block diagram of a memory unit is shown below:

17
Data lines provide the information to be stored in memory. The control inputs specify the direct
transfer. The k-address lines specify the word chosen.

When there are k address lines, 2k memory words can be accessed.

Types of Computer Memory

 Cache Memory: This temporary storage area, known as a cache, is more readily available to
the processor than the computer's main memory source. It is also called CPU memory because
it is typically integrated directly into the CPU chip or placed on a separate chip with
a bus interconnect with the CPU.

 RAM: It is one of the parts of the Main memory, also famously known as Read Write
Memory. Random Access memory is present on the motherboard and the computer’s data is
temporarily stored in RAM. As the name says, RAM can help in both Read and write.

 D RAM (Dynamic RAM): D RAM uses capacitors and transistors and stores the data as a
charge on the capacitors. They contain thousands of memory cells. It needs refreshing of
charge on capacitor after a few milliseconds. This memory is slower than S RAM.

 S RAM (Static RAM): S RAM uses transistors and the circuits of this memory are capable of
retaining their state as long as the power is applied. This memory consists of the number of
flip flops with each flip flop storing 1 bit. It has less access time and hence, it is faster.

 ROM: ROM full form is Read Only Memory. ROM is a non volatile memory and it is used
to store important information which is used to operate the system. We can only read the
programs and data stored on it and can not modify of delete it.
18
 MROM(Masked ROM): Hard-wired devices with a pre-programmed collection of data or
instructions were the first ROMs. Masked ROMs are a type of low-cost ROM that works in
this way.

 PROM (Programmable Read Only Memory): This read-only memory is modifiable once
by the user. The user purchases a blank PROM and uses a PROM program to put the required
contents into the PROM. Its content can’t be erased once written.

 EPROM (Erasable Programmable Read Only Memory): EPROM is an extension to


PROM where you can erase the content of ROM by exposing it to Ultraviolet rays for nearly
40 minutes.

 EEPROM (Electrically Erasable Programmable Read Only Memory): Here the written
contents can be erased electrically. You can delete and reprogram EEPROM up to 10,000
times. Erasing and programming take very little time, i.e., nearly 4 -10ms(milliseconds). Any
area in an EEPROM can be wiped and programmed selectively.

 Virtual memory: A memory management technique where secondary memory can be used
as if it were a part of the main memory. Virtual memory uses hardware and software to enable
a computer to compensate for physical memory shortages by temporarily transferring data
from RAM to disk storage.

What is Primary Memory?

It is also referred to as main memory or internal memory. It is a computer system's temporary storage
component which is directly accessible by the central processing unit (CPU). It houses data for
immediate processing.

Characteristics

 volatile: Data is lost upon power loss.

 High-speed access.

 Limited capacity relative to secondary storage.

 Examples: Random Access Memory(RAM), Read-Only Memory, Cache memory.

Advantages

 High-speed access: Data can be retrieved and stored very quickly.

 Directly accessible by CPU: No intermediate steps are required for data transfer.

19
Disadvantages

 Volatile: Data is lost when power is turned off.

 Limited storage capacity: compared to secondary storage, primary memory is relatively


small.

 Expensive: Cost per unit is higher than secondary storage.

Different Applications of Primary Memory are:

 Temporary storage

 Multitasking

 Buffering

 Caching

What is Secondary Memory?

Secondary memory or external memory serves as long-term storge for data and programs. Unlike
primary memory, it is not directly accessible by the CPU and requires input/output operations.

Characteristics

 Non-volatile: Data persists even when the system is powered off.

 slower access speeds compared to primary memory.

 High storage capacity.

 Examples: Hard Disk Drives(HDD), Solid-State Drives(SSD), Optical drives(CD, DVD, Blu-
ray).

Advantages

 Non-volatile: Data persists even when the power is turned off.

 Large storage capacity: can store vast amount of data.

 Relatively Inexpensive: cost-effective for storing large volumes of data.

Disadvantages

 Slower access time: Data retrieval is slower compared to primary memory.

 Requires input/output operations: Data transfer involves additional steps.

20
Different Applications of Primary Memory are:

 Long-term storage

 Operating system installation

 Software installation

 Data backup

 Media storage

Units of Memory

Memory units are used to measure the size and represent data. Some of the commonly used memory
units are:

1. Bit

The first memory location in a computer is bit. The smallest measurement unit for data held
in primary memory and storage devices is a bit. Out of the binary values 0 and 1, a bit can only have
one.

 The smallest measurement unit for data in primary memory and storage devices.

 Represents binary values 0 and 1.

2. Nibble

 It means the group of 4 bits.

3. Word

It is a fixed number of bits, it is different from computer to computer, but the same for each device.
Compute store information in the form of words.

 A fixed number of bits that varies across computers but remains consistent within each
device.

 Used to store information in computers.

4. Bytes

The fundamental unit used to measure data is the byte. It has 8 bits in it. A byte can therefore
represent 2 * 8 or 256 values. They determine the size of files, documents, photos, and other kinds of
data.

21
 The fundamental unit for measuring data, consisting of 8 bits.

 Represents 256 values and determines file, document, photo, and data sizes.

5. Kilobyte

1024 bytes is equal to one kilobyte. It is widely used to denote small file sizes and data storage
capacities. One kilobyte can hold a small image or around 1024 characters of text. It frequently
shows up in text documents, spreadsheets, and small image files.

 Equal to 1024 bytes.

 Denotes small file sizes and storage capacities.

 Can hold small images or around 1024 characters of text.

6. Megabyte

A megabyte is 1024 kilobytes in size. It contains more info as compared to a kilobyte. A megabyte
can hold longer texts, high-resolution images, and short audio clips. It is used to calculate the size of
files comprising music and short films, software packages, and documents. Megabytes are still
important and frequently used, even though larger units of measurement are being used more
frequently as a result of the growing number of data files.

 Comprising 1024 kilobytes.

 Contains more information compared to a kilobyte.

 Holds longer texts, high-resolution images, and short audio clips.

 Measures file sizes of music, short films, software packages, and documents.

7. Gigabyte

1024 megabytes is equal to one gigabyte. It has a substantial amount of data storage space. Larger
files, such full photo albums, high-definition movies, and software programs can fit within a gigabit.
The storage capabilities of hard drives, solid-state drives, and other forms of data storage devices are
routinely assessed utilizing this technique.

 Equal to 1024 megabytes.

 Offers substantial data storage space.

 Suitable for larger files, such as full photo albums, high-definition movies, and software
programs.

8. Terabyte
22
A terabyte is made up of 1024 gigabytes. It has a substantial amount of data storing capacity. A
terabyte can hold a lot of data in large databases, massive media collections, and enterprise-level
storage systems. It is frequently used by data centers, cloud storage services, and external hard drives
with large storage capacities. As the demand for large-scale data processing and storage grows,
terabytes are becoming more and more important.

 Comprising 1024 gigabytes.

 Provides substantial data storing capacity.

 Holds large databases, media collections, and enterprise-level storage systems.

9. Petabyte

A petabyte is a colossal unit of data storage capacity. A petabyte may hold massive amounts of data,
including significant video libraries, sizable databases, and sizable collections of high-resolution
pictures. It is often used in data centers, cloud storage, and scientific research that uses a lot of data.

 A colossal unit of data storage capacity.

 Stores massive data quantities, like video libraries and large databases.

10. Exabyte (1024 petabytes)

An exabyte is equal to one EB. It has a substantial amount of data storage space. Exabytes can store
vast film archives, massive data warehouses, and global internet traffic. It is extensively used in
large-scale scientific simulations, cloud computing infrastructures, and enterprise-level storage
systems.

 Equal to 1024 petabytes.

 Holds vast film archives, data warehouses, and global internet traffic.

11. Zettabyte (1024 exabytes)

A zettabyte. It represents a capacity for data storage that is almost unimaginable. Zettabytes have the
capacity to store unfathomably large amounts of data, including worldwide internet content, long-
term archival storage, and in-depth global data analysis.

 Represents an almost unimaginable data storage capacity.

 Stores worldwide internet content, long-term archival data, and extensive global analysis.

12. Yottabyte

23
1024 zettabytes make up a yottabyte (abbreviated YB). It stands for an incredible amount of data
storage. Unimaginable amounts of data, such as the equivalent of storing all of the material on the
internet numerous times or tracking vast amounts, may be stored in yottabytes.

 Comprising 1024 zettabytes.

 Stands for an incredible amount of data storage.

 Can hold vast amounts equivalent to storing internet content numerous times.

Functions of Memory Unit

The memory unit of a computer has several functions:

 Stores Data and Instructions: The memory unit stores data and instructions needed by
the CPU to perform tasks efficiently. This includes data related to operations to be performed
and data related to the program.

 Tracks Interim Results: The memory unit keeps track of the interim results of processing.

 Saves Final Results: The memory unit saves the final processing results before sending them
to an output device.

 Receives And Transmits Inputs And Outputs: The memory unit receives and transmits all
inputs and outputs.

The size of the memory unit affects its speed, power, and capabilities. without a memory unit, the
processor would have to wait longer for data retrieval.

Conversions of Units

Name Equal To Size (In Bytes)

Bit 1 Bit 1/8

Nibble 4 Bits 1/2 (rare)

Byte 8 Bits 1

Kilobyte 1024 Bytes 1024

24
Name Equal To Size (In Bytes)

Megabyt
1024 Kilobytes 1, 048, 576
e

Gigabyte 1024 Megabytes 1, 073, 741, 824

Terabyte 1024 Gigabytes 1, 099, 511, 627, 776

Petabyte 1024 Terabytes 1, 125, 899, 906, 842, 624

Exabyte 1024 Petabytes 1, 152, 921, 504, 606, 846, 976

Zettabyte 1024 Exabytes 1, 180, 591, 620, 717, 411, 303, 424

Yottabyte 1024 Zettabytes 1, 208, 925, 819, 614, 629, 174, 706, 176

Memory Hierarchy

Memory hierarchy is the organization of different types of memory in a computer system based on
their speed, cost, and size. Faster and more expensive memory, like registers and cache, is placed
closer to the CPU, while slower and larger memory, like RAM and hard drives, is further away. This
arrangement helps the computer work efficiently by storing frequently used data in faster memory
and less-used data in slower memory.

25
Conclusion

Memory is the vital component of a computer system that stores data and instructions for processing.
It is divided into various types, each with its specific characteristics and purpose. From the rapid
access of RAM to the persistent storage of ROM and the vast capacities of secondary storage,
memory units are fundamental to the operation of modern computers.

I/O Instructions

In computer architecture, I/O instructions are special instructions that enable the CPU to
communicate with external devices (like keyboards, mice, printers, disks, or network interfaces).
These instructions help the processor to send data to or receive data from peripheral devices.

Why are I/O Instructions Important?

 CPUs mainly operate on data in main memory (RAM).

 External devices are usually connected through I/O ports or memory-mapped I/O.

 I/O instructions allow the CPU to manage data transfer between RAM and I/O devices,
making the computer system interact with the real world.

How Do I/O Instructions Work?

26
There are two common models for handling I/O in computer systems:

1. Isolated I/O (Port-Mapped I/O)

o Uses separate instructions (like IN and OUT) to read from/write to device ports.

o Example (x86 architecture):

assembly

IN AL, DX ; Read data from port specified in DX into AL

OUT DX, AL ; Write data from AL to port specified in DX

2. Memory-Mapped I/O

o Treats device registers as memory addresses.

o The CPU uses standard memory instructions (MOV, LOAD, STORE) to interact with
devices.

o No separate I/O instructions are needed.

Types of I/O Instructions

Instruction Purpose

IN Reads data from an I/O port into a CPU register

OUT Writes data from a CPU register to an I/O port

INS Input string (reads a block of data from I/O port to memory)

OUTS Output string (writes a block of data from memory to I/O port)

Summary

I/O instructions give the CPU a way to communicate with peripheral devices, either through special
instructions (isolated I/O) or by treating devices like memory (memory-mapped I/O). They are
crucial for enabling your computer to interact with the external world!

27

You might also like