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

Chapter 2 Basic Elements of an Operating System (Updated)

Uploaded by

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

Chapter 2 Basic Elements of an Operating System (Updated)

Uploaded by

black hello
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 26

Chapter 2

Basic Elements of an Operating


System
2.1 Basic unit of data representation

Bits are grouped to form bytes, which in turn are


grouped to form words.

1.3.2. Basic elements of computer system –


Memory, Processor and I/O Unit
2.1 Basic unit of data representation
• Computers information is encoded as patterns of 0s and
1s. These digits are called bits (short for binary digits).

• Although you may be inclined to associate bits with


numeric values, they are really only symbols whose
meaning depends on the application at hand.

• Sometimes patterns of bits are used to represent numeric


values; sometimes they represent characters in an
alphabet and punctuation marks; sometimes they
represent images; and sometimes they represent sounds.

• A computer’s main memory is organized in manageable


units called cells, with a typical cell size being eight bits.
(A string of eight bits is called a byte. Thus, a typical
memory cell has a capacity of one byte.)
2.1.1. Memory
•Memory holds active programs and data. A program
must be stored in memory before it can be
executed.
•Data must be stored in memory before the
computer can manipulate them.
•Memory write is a destructive operation.
•Memory read is not destructive
• Depending on the computer, bytes or words are the
basic addressable units of memory.
Memory Address
► Consist of a number of
locations (cells)
► Each location has a
number called address.
► If a memory has n
locations (cells), they will
have addresses 0 to n-1.
► All locations in the ??
memory contain the same
number of bits.
Memory Address
► If a location of k bits, it can
hold any one of 4 different
bit combinations

► (k bits => can hold 2k


combinations)

► if K= 4 then 16 locations

► In fact, for an address used


to reference the memory
need at least 4 bits in
order to express all the
address numbers from 0 to
11.
Source: https://slideplayer.com/slide/13830027/
Memory
Address

Figure 1

Test yourself (refer to Figure 1)


1. What is the memory address length?
2. What is the memory cell length?
3. How many cells of memory?
Step By Step : EXPLAIN HOW THE
COMPUTER MEMORY WORKING?
SIZES • WRITE : Address, Value “X”

0 X
• READ : Value
1
Address
2 At the beginning : CELL = garbage
3 Memory Sizes : CELL X CELL SIZE
ADDRESS

4
( 1 byte , 2 byte , 4 byte …….)
8 bits  1 Bytes  1024 Bytes
10
1024 (2 ) bytes  Kilobytes (2 10)

Kbytes  megabytes (2 ) bytes


20

30
mbytes  gigabytes (2 ) bytes
40
gbytes  terabytes (2 ) bytes
CELL

SIZES n-1
The Operation of Memory
►The MAR (Memory Address Register) and
MDR(Memory Data Register) act as an
interface between the CPU and Memory.
• MAR is connected to the address bus. Its
main function is to contain the RAM address for
the instruction the CPU needs next to read/write
(fetched/stored).
• MDR is connected to the data bus. The MDR
holds the data is needed to be written to the
RAM, or has been read from the RAM.
•Address Decoder is decoding the address in MAR.
Translation lookaside buffer (TLB) is a memory cache
“Decode the address in MAR” mean that memory
unit must translate the N-bit address stored in the
MAR into the set of signals needed to access that one
a byte
specific memory cell.
Individual
memory
cells

a bit

Address line
Test Yourself
1. Assuming that the MAR is “110110”. Decode the address
in MAR
Data Transfers:
Need Instructions:
• FETCH – instr to read content of a memory location
(fetch some data from memory)
• STORE – instr to write a value to a memory location
(store some data into memory)
Need Special Registers:
• MAR – for the address of the memory location;
• MDR – for data to be written to / read from memory
implemented via digital circuitry
• Using decoders to select individual cells
• Fetch / Store decoder
Fetch(10110) read data from the data bus into the
MDR
Step1
Step 3Step2 .. Decode
. Copy Load thethe
address
the contents of theinto
address inMAR
memory location into the MDR
the MAR

Address Cell Content


110000 10100110
110001 10101101
110010 10101010

MAR 110001

MDR 10101101
Store(10110,11111111)
1.3.Value
4.
2. Address
Load fromisMDR
value
address decoded
into and
isMAR
MDR
into put intocell
theisselected
selected
cell(memory location)
Address Cell Content
10100 00100110
10101 10100110
10110 00111110
11111111
10111 10101010

MAR 10110

MDR 11111111
Cache Memory
• Quickly accessible memory that’s stores copy of
frequently used data in an easily accessible memory area
instead of main memory.
2. 2.The Processor
The processor manipulates data stored in memory
under the control of a program stored in memory.
2. 2.The Processor
• A program is a series of instructions.
• Each instruction has an operation code and one
or more operands
2. 2.The Processor
The processor contains four key components.
2.3. Input and Output
The input/output control system (IOCS)
communicates directly with the computer’s
peripheral devices.

The command processor is the OS module that


accepts, interprets and carries out commands
Application programs issue logical requests to start input
or to start output. The input/output control system accepts
these logical I/0 requests and generates the primitive
commands needed to physically control the peripheral
devices.

Primitive command – a low-level operation that causes a


peripheral device to perform a single task,

Logical I/O – the programmer’s view-one logical record

Physical I/O –the transfer of a physical record between


memory and a peripheral device
2.4. Memory Capacity &
Processor Speed
• On most systems, the internal components are
designed around a common word size.
• Example:
On a 32-bit computer, the processor manipulates
32-bit numbers, memory and the registers store 32-
bit words, and data and instructions move between
the components over a 32-bit bus.
• A computer’s word size affects its processing speed,
memory capacity, precision, instruction set size, and
cost.
2.4.1 Processor Speed

Example of how word-size can affect processing


speed.
•A 32-bit bus contains 32 wires and thus can carry 32
bits at a time.
•A 16-bit bus has only 16 parallel wires and thus can
carry only 16 bits at a time.
•Because the bus moves twice as much data in the
same amount of time, the 32-bit machine is clearly
faster.
•Generally, the bigger the word size the faster the
computer is.
2.4.2 Memory Capacity
Example of how memory capacity can be affected by
word size
• To access memory, the processor must transmit over a
bus the address of desired instruction or data element.
• On a 32-bit machine, a 32-bit address can be
transmitted.
• The biggest 32-bit number is roughly 4 billion in decimal
terms, so the processor can access as many as 4 billion
different memory locations.
• A 16-bit computer, transmits a 16-bit address, limiting it
to roughly 64,000 memory locations.
• Generally, the bigger its word size, the more memory
a computer can address.

You might also like