Unit 1
Unit 1
Term:2015-2016
III Year B.Tech I Sem
COURSE OUTCOMES:
Acquires the basic knowledge on Computer system and their memory system.
Acquires the basic knowledge on Microprossesors-8085, 8086.
Understand programming Concept of 8086.
Understands the interfacing of various advanced devices with 8086-
Microprossesor.
Acquires an basic knowledge Serial communication and their standards.
Understands the basic microcontrollers---8051 and their programming.
Acquires an basic knowledge of RISC Controller.
COMPUTER
ORGANIZATION
UNITWISE COURSE OBJECTIVE
UNIT-I
To study different Types of Computer.
To understand the Functional Units of Computer.
To understand the Basic Operational Concepts of Computer System.
To know about Data Representations in different forms.
To understand Concepts of Various Memories.
UNIT-II
To discuss the Architecture of 8086
To discuss the pin description of 8086.
To discuss the various addressing modes and instruction set of 8086
To understand ALP programming Concept of 8086
To know about modes of 8086 and Timing Diagrams
To understand Macros and Procedures.
UNIT-III
UNIT-V
To study the operation of timers, counters & serial communication of 8051 MC.
To understand the programming concept of external interrupt in 8051 MC.
To understand how a timer are programmed in 8051 microcontroller
UNIT-I COURSE OBJECTIVE
Memory
Output Control
I/O Processor
Data
PC Address Register #
Register A
Instructions Bank L Address
U
Register #
Instruction Data Memory
Memory
Register #
Data
MAR MDR
Control
PC R0
R1
Processor
IR
ALU
Rn - 1
n general purpose
registers
0 1 1 1 +7 +7 + 7
0 1 1 0 +6 +6 + 6
0 1 0 1 +5 +5 + 5
0 1 0 0 +4 +4 + 4
0 0 1 1 +3 +3 + 3
0 0 1 0 +2 +2 + 2
0 0 0 1 +1 +1 + 1
0 0 0 0 +0 +0 + 0
1 0 0 0 - 0 -7 - 8
1 0 0 1 - 1 -6 - 7
1 0 1 0 - 2 -5 - 6
1 0 1 1 - 3 -4 - 5
1 1 0 0 - 4 -3 - 4
1 1 0 1 - 5 -2 - 3
1 1 1 0 - 6 - 1 - 2
1 1 1 1 - 7 -0 - 1
-1 +0 -1 +0
-2 1111 0000 +1 -2 1111 0000 +1
1110 0001 1110 0001
-3 +2 -3
1101 1101 +2
0010 0010
-4 -4
1100 0011 +3 1100 0011 +3
-5 1011 -5 1011
0100 +4 0100 +4
1010 1010
-6 0101 -6 0101
1001
+5 +5
0110 1001
0110
-7 1000 0111 +6 -7 1000 +6
0111
-8 +7 -8 +7
5 + 3 = -8 -7 - 2 = +7
Overflow Conditions
0111 1000
5 0101 -7 1001
3 0011 -2 1100
-8 1000 7 10111
Overflow Overflow
0000 1111
5 0101 -3 1101
2 0010 -5 1011
7 0111 -8 11000
No overflow No overflow
Overflow when carry-in to the high-order bit does not equal carry out
Sign Extension
Task:
Given w-bit signed integer x
Convert it to w+k-bit integer with same value
Rule:
Make k copies of sign bit:
X = xw–1 ,…, xw–1 , xw–1 , xw–2 ,…, x0
w
X • • •
k copies of MSB
• • •
X • • • • • •
k w
Sign Extension Example
Control lines
( R / W, MFC, etc.)
Some basic concepts(Contd.,)
Measures for the speed of a memory:
memory access time.
memory cycle time.
An important design issue is to provide a
computer system with as large and fast a
memory as possible, within a given cost
target.
Several techniques to increase the effective
size and speed of the memory:
Cache memory (to increase the effective speed).
Virtual memory (to increase the effective size).
Internal organization of memory
chips
Each memory cell can hold one bit of information.
Memory cells are organized in the form of an array.
One row is one memory word.
All cells of a row are connected to a common line,
known as the “word line”.
Word line is connected to the address decoder.
Sense/write circuits are connected to the data
input/output lines of the memory chip.
7 7 1 1 0 0
W0
•
•
•
FF FF
A0 W1
•
•
•
A1
Address Memory
decoder • • • • • • cells
A2 • • • • • •
• • • • • •
A3
W15
•
•
•
T1 T2
X Y
Word line
Bit lines
Asynchronous DRAM’s
Each row can store 512
RAS bytes. 12 bits to select a
row, and 9 bits to select
a group in a row. Total of
Row
address Row 4096 512 8 21 bits.
latch decoder cell array
• First apply the row
address, RAS signal
latches the row address.
Then apply the column
A20- 9 A8 - 0 Sense / Write CS
circuits address, CAS signal
R /W
latches the address.
• Timing of the memory
Column
Column
unit is controlled by a
address
latch
decoder specialized unit which
generates RAS and CAS.
• This is asynchronous
CAS D7 D0
DRAM
•Operation is directly synchronized
Refresh
counter with processor clock signal.
•The outputs of the sense circuits are
connected to a latch.
Row
•During a Read operation, the
Row
address decoder Cell array contents of the cells in a row are
latch
Row/Column loaded onto the latches.
address •During a refresh operation, the
Column Column Read/Write contents of the cells are refreshed
address
decoder circuits & latches without changing the contents of
counter
the latches.
•Data held in the latches correspond
Clock
to the selected columns are transferred
R AS to the output.
Mode register
CAS and Data input •For a burst mode of operation,
Data output
register register
R/ W timing control successive columns are selected using
CS column address counter and clock.
CAS signal need not be generated
externally. A new data is placed during
Data
raising edge of the clock
1.5.2 Read-Only Memory (ROM)
SRAM and SDRAM chips are volatile:
Lose the contents when the power is turned off.
Many applications need memory devices to retain
contents after the power is turned off.
For example, computer is turned on, the operating
system must be loaded from the disk into the memory.
Store instructions which would load the OS from the disk.
Need to store these instructions so that they will not be
lost after the power is turned off.
We need to store the instructions into a non-volatile
memory.
Non-volatile memory is read in the same manner as
volatile memory.
Separate writing process is needed to place information
in this memory.
Normal operation involves only reading of data, this type
of memory is called Read-Only memory (ROM).
Read-Only Memories (Contd.,)
Read-Only Memory:
Data are written into a ROM when it is manufactured.
Programmable Read-Only Memory (PROM):
Allow the data to be loaded by a user.
Process of inserting the data is irreversible.
Storing information specific to a user in a ROM is expensive.
Providing programming capability to a user may be better.
Erasable Programmable Read-Only Memory
(EPROM):
Stored data to be erased and new data to be loaded.
Flexibility, useful during the development phase of digital
systems.
Erasable, reprogrammable ROM.
Erasure requires exposing the ROM to UV light.
Read-Only Memories (Contd.,)
Electrically Erasable Programmable Read-Only
Memory (EEPROM):
To erase the contents of EPROMs, they have to be exposed to ultraviolet
light.
Physically removed from the circuit.
EEPROMs the contents can be stored and erased electrically.
Flash memory:
Has similar approach to EEPROM.
Read the contents of a single cell, but write the
contents of an entire block of cells.
Flash devices have greater density.
▪ Higher capacity and low storage cost per bit.
Power consumption of flash memory is very low, making
it attractive for use in equipment that is battery-driven.
Single flash chips are not sufficiently large, so
larger memory modules are implemented using
flash cards and flash drives.
1.5.3 Cache Memories
Processor is much faster than the main memory.
As a result, the processor has to spend much of its time waiting
while instructions and data are being fetched from the main memory.
Major obstacle towards achieving good performance.
Block 4095
Cache
Main
memory Block 0Blocks of cache are grouped into sets.
tag Block 0 Mapping function allows a block of the main
Block 1
tag
memory to reside in any block of a specific set.
Block 1
Divide the cache into 64 sets, with two blocks per set.
tag Block 2 Memory block 0, 64, 128 etc. map to block 0, and they
tag Block 3 can occupy either of the two positions.
Block 63Memory address is divided into three fields:
Block 4095
1.5.4 Virtual memories
Recall that an important challenge in the
design of a computer system is to provide a
large, fast memory system at an affordable
cost.
Architectural solutions to increase the effective
speed and size of the memory system.
Cache memories were developed to increase
the effective speed of the memory system.
Virtual memory is an architectural solution to
increase the effective size of the memory
system.
57
Virtual memories (contd..)
Recall that the addressable memory space depends
on the number of address bits in a computer.
For example, if a computer issues 32-bit addresses, the addressable
memory space is 4G bytes.
Physical main memory in a computer is generally
not as large as the entire possible addressable
space.
Physical memory typically ranges from a few hundred megabytes to 1G
bytes.
Large programs that cannot fit completely into the
main memory have their parts stored on secondary
storage devices such as magnetic disks.
Pieces of programs must be transferred to the main memory from
secondary storage before they can be executed.
58
Processor
•Memory management unit (MMU) translates
virtual addresses into physical addresses.
Virtual address
•If the desired data or instructions are in the
main memory they are fetched as described
Data MMU
previously.
•If the desired data or instructions are not in
Physical address
the main memory, they must be transferred
from secondary storage to the main memory.
Cache •MMU causes the operating system to bring
the data from the secondary storage into the
Data main memory.
Physical address
Main memory
DMA transfer
Disk storage
59
Address translation
Assume that program and data are composed of
fixed-length units called pages.
A page consists of a block of words that occupy
contiguous locations in the main memory.
Page is a basic unit of information that is
transferred between secondary storage and main
memory.
Size of a page commonly ranges from 2K to 16K
bytes.
Pages should not be too small, because the access time of a secondary
storage device is much larger than the main memory.
Pages should not be too large, else a large portion of the page may not
be used, and it will occupy valuable space in the main memory.
60
Address translation (contd..)
Each virtual or logical address generated by a
processor is interpreted as a virtual page
number (high-order bits) plus an offset (low-
order bits) that specifies the location of a
particular byte within that page.
Information about the main memory location of
each page is kept in the page table.
Main memory address where the page is stored.
Current status of the page.
Area of the main memory that can hold a page is
called as page frame.
Starting address of the page table is kept in a
page table base register.
61
Address translation (contd..)
Virtual page number generated by the
processor is added to the contents of the
page table base register.
This provides the address of the corresponding entry in the
page table.
The contents of this location in the page table
give the starting address of the page if the
page is currently in the main memory.
62
PTBR holds Virtual address from processor
Page table base register
the address of
the page table. Page table address Virtual page number Offset
Virtual address is
interpreted as page
+ number and offset.
PAGE TABLE
PTBR + virtual
page number provide
the entry of the page This entry has the starting location
in the page table. of the page.
63
Address translation (contd..)
Page table entry for a page also includes some
control bits which describe the status of the
page while it is in the main memory.
One bit indicates the validity of the page.
Indicates whether the page is actually loaded into the main memory.
Allows the operating system to invalidate the page without actually
removing it.
One bit indicates whether the page has been
modified during its residency in the main
memory.
This bit determines whether the page should be written back to the
disk when it is removed from the main memory.
Similar to the dirty or modified bit in case of cache memory.
64
Address translation (contd..)
A small cache called as Translation Lookaside
Buffer (TLB) is included in the MMU.
TLB holds page table entries of the most recently accessed pages.
Recall that cache memory holds most recently
accessed blocks from the main memory.
Operation of the TLB and page table in the main memory is similar
to the operation of the cache and main memory.
Page table entry for a page includes:
Address of the page frame where the page resides in the main
memory.
Some control bits.
In addition to the above for each page, TLB must
hold the virtual page number for each page.
65
Address translation (contd..)
How to ensure that the interrupted task can
continue correctly when it resumes
execution?
There are two possibilities:
Execution of the interrupted task must continue from the point
where it was interrupted.
The instruction must be restarted.
66
1.5.5 Secondary Storage Memories
Magnetic Hard Disks
Disk
Disk drive
Disk controller
Organization of Data on a Disk
Sector 0, track 1
Sector 3, track n
Sector 0, track 0
Disk Controller
Seek
Read
Write
Error checking
Disk Controller
Processor Main memory
System bus
Disk controller
Pit Land
Reflection Reflection
No reflection
0 1 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0