Software and Systems Engineering Standards: Verification and Validation of Sy...
CSE331_Lecture1.pptx
1. Course code: CSE331
Course Title: Microprocessor Interfacing &
Embedded System
Semester: Spring 2023
Course Teacher
Dr. Monir Morshed
Professor
Email:monir.morshed@northsouth.edu
2. An introduction to the fundamental concept of
microprocessor architecture and microprocessor based
embedded systems.
A basic idea of the internal and external architecture of the
microprocessor 8086.
The course will also cover the other peripheral devices of a
microprocessor-based system i.e. RAM 6116, PIO 8255
Controller and 7-Segment Display.
The course will then cover the programming languages for
interfacing:
A brief introduction to the Microcontroller 8051 will also be
provided.
This course has separate mandatory laboratory session
every week as CSE 331L
Course Contents
3. Recommended Books
Text Book 1. Douglas V. Hall 1990 Microprocessor and Interfacing
Third McGraw-Hill,978-070257429
2. Charles Marut and Ytha Y. Yu 2011 Assembly
Language Programming and Organization of the IBM
PC - McGraw-Hill 978-0-470-23399-3
Reference 1. MA Mazidi et al. 2012 PIC Microcontroller and
Embedded Systems -Pearson 978-0-13-600902-3
4. Course Objectives
1. To introduce the internal and external architecture
of microprocessor 8086
2. To explain the interconnection of microprocessor
and different peripheral devices
3. To introduce Assembly language for direct
manipulation of microprocessor 8086
4. To introduce to simulation tool i.e. emulator 8086
for simulation based works
5. Course Outcomes
Course
Outcomes
CO Description
1 identify the building blocks of microprocessor-
based systems
2 construct code in Assembly language for
microprocessors and microcontrollers
3 use emulators to program microprocessors
4 design microprocessor or microcontroller-based
systems using hardware and software interface.
6. CO with Assessment Methods
Any Suggestions?
Assessment Tools (%)
Class Performance 5%
Class Test/Quiz 15%
Final Exam 30%
Mid Exam 20%
Assignment/Presentation 10%
Lab Work 10%
Term Project 10%
7. Introduction
Outlines:
Historical background of the invention and evolution of
microprocessors.
Moore's law and its significance
Key features of microprocessors (µPs) and
microcontrollers (µCs)
Distinction between a microprocessor and a
microcontroller
Applications of microprocessors and microcontrollers
8. Historical Background
1947- Invention of Transistor
1959-Invention of Integrated Circuit
1965-Births of Moore’s Law
1971-Development of First µP
1976-Introduction of First µC
9. 1947- Invention of Transistor
• On December 23, 1947, Dr. S. William Shockley, Walter H. Brattain, and
John Bardeen demonstrated the amplifying action of the first transistor at the
Bell Telephone Laboratories.
• In early 1948, Dr. S. William Shockley came up with refined transistor
called the Bipolar Junction Transistor (BJT).
• On June 30, 1948, Bell Labs officially announced the first transistor at a
press conference in New York.
• The first transistor used two closely spaced gold contacts pressed onto the
surface of a slab of high-purity germanium
Shockley, Bardeen and Brattain shared the 1956 Nobel Prize in Physics for the
transistor.
10. Advantages: Transistor has few advantages over
tube devices
• Smaller and lightweight.
• No heater requirement.
• A rugged construction.
• Takes less power
• Require no warm-up period
• Lower operating voltages
1947- Invention of Transistor
11. Integrated Circuits
An integrated circuit (IC), sometimes called a chip, microchip or
microelectronic circuit is one in which, thousands or millions of
tiny resistors, capacitors, diodes and transistors are fabricated on a
single semiconductor wafer. An IC can function as an amplifier, oscillator,
timer, counter, logic gate, computer memory, microcontroller
or microprocessor.
IC History Dates:
May 7, 1952: First conceived as a monolithic integrated circuit in 1952 by
Geoffrey Drummer.
December 1, 1957: Jean Hoerni concieves of a bipolar planar technology.
August 28 1958: First implemented by Jack Kilby as a heterogeneous IC of
transistors wire-bonded together.
Late 1958: Kurt Lehovec concieves of way to isolate transistors in silicon. Patent
filed April 22, 1959
January 23, 1959: First planar IC with lithographically patterned metal
interconnect described in Robert Noyce's notebook. This would become the basis
for all modern IC technology.
March 12, 1959 First planar transistor prototype made by Hoerni, which would
become the 2N1613 planar transistor announced by Fairchild Semiconductor in
April 1960.
September 27, 1960: Jay Last's group successfully yields an Integrated Circuit.
12. Evolution of IC technology
Year Technology No. of transistors Example
1947-1950 Transistor 1 -
1951 -1960 Discrete Component 1 FET, Diode
1961 -1966
SSI
- Small scale integration
10 Logic Gates, Flip-flop
1967-1971
MSI
- Medium scale
integration
100 – 1000
Counter, Multiplexer, Decoder,
Adder
1972-1980
LSI
- Large scale integration
1000 – 20,000 RAM, 8-bit Microprocessor
1981 -1990
VLSI
- Very large scale
integration
20,000 –
1,000,000
16 bits and 32 bits
Microprocessor
1990-2000
ULSI
- Ultra large scale
integration
1,000,000 –
10,000,000
Graphic microprocessor (64-
bit)
2000 -
nowadays
GSI
- Giant scale integration
> 10,000,000
Pentium Dual Core
Microprocessor
13. Moore’s Law
Moore’s law states that the number of transistors on a chip doubles every 24
months. Some definitions use 18 months as the doubling period instead of 2
years.
The cost of manufacturing a transistor drops by half about every 2 years
By 1975, the number
of components per
integrated circuit for
minimum cost will be
65,000. So, they
invented dynamic
RAM with 65000
transistors
64
transistors
in 1966
32
transistors
in 1965
15. Microprocessors
Central Processing Unit (CPU) of a computer which is built on a single
Integrated Circuit (IC) is called a microprocessor. It is also referred to as the
MPU.
The microprocessor is programmable multipurpose silicon chip, clock
driven register based device, accepts binary data as input and provides
output after processing it as per the instructions stored in the memory.
Microprocessor fetch, decode and execute the instruction.
The terms CPU, µP and MPU (microprocessor unit) are synonymous.
CPU is the combination of the ALU, register array and control unit of any
computer.
16. Microprocessors Unit (MPU)
Microprocessor typically contains: Arithmetic and
Logical Unit, Control Unit, and Register array
Registers: Temporary storage locations for program
instruction or data
The arithmetic logic unit (ALU): This part of the
MPU performs both arithmetic and logical
operations.
Timing and Control units: That keeps all of the
parts of system (registers, ALU, memory and I/O
devices) working together in the right time
sequence.
18. Central Processing Unit (CPU)
• The computer central processing unit has three parts: ALU, Control unit and
Register.
• ALU: The ALU is a complex digital circuit with an AU (arithmetic unit) and
a LU (logic unit).
The arithmetic unit handles the following operations
‣ Add - add two bits.
‣ Add with carry - add two bits with a carry-in.
‣ Subtract - subtract two bits.
‣ Subtract with borrow - subtract two bits with borrow from
carry-in.
‣ Negate - flip the bits values sign (- to + or + to -).
‣ Increment - add 1 to a bit.
‣ Decrement - subtract 1 from a bit.
‣ Pass through - let bits through without modification
Logic unit does the following operation
‣ AND, OR, and NOT
‣ checking if a number is a negative number
19. Control Unit (CU)
• Control Unit directs the operation of the processor.
• The responsibility of the Control Unit to tell the
computer’s memory, arithmetic/logic unit and input and
output devices how to respond to the instructions that have
been sent to the processor.
• It tells the microprocessor how to decode and execute the
program-a set of instructions.
• If fetches them one at a time and decodes the instruction.
Then control logic carries out or execute the decoded
instruction.
20. Bus
• A bus is a common communication pathway
used to carry information between the various
elements of a computer system.
• The term BUS refers to a group of wires or
conduction tracks on a printed circuit board
(PCB) through which binary information is
transferred from one part of the microcomputer
to another.
• There are three main bus group:
Address bus
Data bus
Control bus
21. Bus
Address bus: used to specify a physical memory address. This can include primary
memory (e.g. RAM and ROM) secondary memory (e.g. hard disk drives) and any other
connected devices. Monitors, printers, scanners, and keyboards will all be mapped to
memory.
The width of the address bus determines the amount of memory that can be addressed.
A 32-bit bus can address 4,294,967,296 (2 ^ 32) bytes of memory. This explains the 4
GB memory restriction on 32-bit operating systems.
Data bus: connects the microprocessor (CPU) with other devices mapped onto the
system. This is often described pictorially using a memory map.
Unlike the address bus, the data bus is bi-directional (it supports read and write
operations). The data bus is not limited to transferring data; it is also used to transfer
program instructions.
Control bus: carries commands from and returns status signals to the microprocessor.
The control unit inside a CPU manages the internal control bus — internal to the CPU
— and the external control bus.
22. The System Components
Hardware: it is the name given to the physical
devices and circuitry of the computer.
Program: A group of instructions performed by
the microprocessor.
Software: It refers to the program written for the
computer.
Firmware: It is the term given to programs stored
in ROMs or devices which permanently keep their
stored information.
23. Microprocessor Operation
• Fetch
• Decode
• Execute
Fetch Cycle
• Fetch the Instruction from Main Memory
The CPU presents the value of the program
counter on the address bus. The CPU then fetches
the instruction from main memory via the data
bus into the Instruction Register.
• Decode the Instruction
The instruction decoder (ID) interprets and
implements the instruction
Execute Cycle
• Get Data from Main Memory
Fetch required data from main memory to be
processed and placed into registers.
• Execute the Instruction
Control signals are initialized to process the data
using ALU and write the result back to a register.
• Store Results
The result generated by the operation is stored in
the main memory, or sent to an output device.
24. Evolution tree of microprocessor
Special Purpose
such as DSPs
Microcontroller
8048, 8051,
8096
4004
8008
8080
8085
8086
8088
80286
80386
Pentium
80486
RSC
Embedded System
25. Intel 4004
Introduced in 1971.
It was the first microprocessor by
Intel.
It was a 4-bit µP.
Its clock speed was 740KHz.
It had 2,300 transistors.
It could execute around 60,000
instructions per second.
25
The first commercial product to use a microprocessor was the Busicom calculator
141-PF
27. Intel 8008
Introduced in 1972.
It was first 8-bit µP.
Its clock speed was 500
KHz.
Could execute 50,000
instructions per second.
27
28. Intel 8080
Introduced in 1974.
It was also 8-bit µP.
Its clock speed was 2 MHz.
It had 6,000 transistors.
Was 10 times faster than 8008.
Could execute 5,00,000
instructions per second.
28
29. Intel 8085
Introduced in 1976.
It was also 8-bit µP.
Its clock speed was 3 MHz.
Its data bus is 8-bit and address bus
is 16-bit.
It had 6,500 transistors.
Could execute 7,69,230 instructions
per second.
It could access 64 KB of memory.
It had 246 instructions.
Over 100 million copies were sold.
29
31. Intel 8086
Introduced in 1978.
It was first 16-bit µP.
Its clock speed is 4.77 MHz, 8 MHz and
10 MHz, depending on the version.
Its data bus is 16-bit and address bus is
20-bit.
It had 29,000 transistors.
Could execute 2.5 million instructions per
second.
It could access 1 MB of memory.
It had 22,000 instructions.
It had Multiply and Divide instructions.
31
32. Intel 8088
Introduced in 1979.
It was also 16-bit µP.
It was created as a cheaper
version of Intel’s 8086.
It was a 16-bit processor with an
8-bit external bus.
Could execute 2.5 million
instructions per second.
This chip became the most
popular in the computer industry
when IBM used it for its first PC.
32
33. Intel 80186 & 80188
Introduced in 1982.
They were 16-bit µPs.
Clock speed was 6 MHz.
80188 was a cheaper version of
80186 with an 8-bit external data
bus.
They had additional components
like:
Interrupt Controller
Clock Generator
Local Bus Controller
Counters
33
34. Intel 80286
Introduced in 1982.
It was 16-bit µP.
Its clock speed was 8 MHz.
Its data bus is 16-bit and
address bus is 24-bit.
It could address 16 MB of
memory.
It had 1,34,000 transistors.
It could execute 4 million
instructions per second.
34
36. Intel 80386
Introduced in 1986.
It was first 32-bit µP.
Its data bus is 32-bit and address bus is 32-bit.
It could address 4 GB of memory.
It had 2,75,000 transistors.
Its clock speed varied from 16 MHz to 33
MHz depending upon the various versions.
Different versions:
80386 DX
80386 SX
80386 SL
Intel 80386 became the best selling
microprocessor in history.
36
37. Intel 80486
Introduced in 1989.
It was also 32-bit µP.
It had 1.2 million transistors.
Its clock speed varied from 16 MHz to
100 MHz depending upon the various
versions.
It had five different versions:
80486 DX
80486 SX
80486 DX2
80486 SL
80486 DX4
8 KB of cache memory was introduced.
37
38. Intel Pentium
Introduced in 1993.
It was also 32-bit µP.
It was originally named 80586.
Its clock speed was 66 MHz.
Its data bus is 32-bit and address bus is 32-
bit.
It could address 4 GB of memory.
Could execute 110 million instructions per
second.
Cache memory:
8 KB for instructions.
8 KB for data.
38
39. Intel Pentium Pro
Introduced in 1995.
It was also 32-bit µP.
It had L2 cache of 256 KB.
It had 21 million transistors.
It was primarily used in server
systems.
Cache memory:
8 KB for instructions.
8 KB for data.
It had L2 cache of 256 KB.
39
40. Intel Pentium II
Introduced in 1997.
It was also 32-bit µP.
Its clock speed was 233 MHz
to 500 MHz.
Could execute 333 million
instructions per second.
MMX technology was
supported.
L2 cache & processor were on
one circuit.
40
41. Intel Pentium II Xeon
Introduced in 1998.
It was also 32-bit µP.
It was designed for servers.
Its clock speed was 400 MHz to
450 MHz.
L1 cache of 32 KB & L2 cache
of 512 KB, 1MB or 2 MB.
It could work with 4 Xeons in
same system.
41
42. Intel Pentium III
Introduced in 1999.
It was also 32-bit µP.
Its clock speed varied from
500 MHz to 1.4 GHz.
It had 9.5 million
transistors.
42
43. Intel Pentium IV
Introduced in 2000.
It was also 32-bit µP.
Its clock speed was from 1.3 GHz
to 3.8 GHz.
L1 cache was of 32 KB & L2
cache of 256 KB.
It had 42 million transistors.
All internal connections were
made from aluminium to copper.
43
44. Intel Dual Core
Introduced in 2006.
It is 32-bit or 64-bit µP.
It has two cores.
Both the cores have there own
internal bus and L1 cache, but share
the external bus and L2 cache (Next
Slide).
It supported SMT technology.
SMT: Simultaneously Multi-
Threading
E.g.: Adobe Photoshop supported
SMT.
44
47. Intel Core 2
Introduced in 2006.
It is a 64-bit µP.
Its clock speed is from 1.2 GHz to
3 GHz.
It has 291 million transistors.
It has 64 KB of L1 cache per core
and 4 MB of L2 cache.
It is launched in three different
versions:
Intel Core 2 Duo
Intel Core 2 Quad
Intel Core 2 Extreme
47
48. Intel Core i7
Introduced in 2008.
It is a 64-bit µP.
It has 4 physical cores.
Its clock speed is from 2.66
GHz to 3.33 GHz.
It has 781 million
transistors.
It has 64 KB of L1 cache
per core, 256 KB of L2
cache and 8 MB of L3
cache.
48
49. Intel Core i5
Introduced in 2009.
It is a 64-bit µP.
It has 4 physical cores.
Its clock speed is from
2.40 GHz to 3.60 GHz.
It has 781 million
transistors.
It has 64 KB of L1
cache per core, 256 KB
of L2 cache and 8 MB
of L3 cache.
49
50. Intel Core i3
Introduced in 2010.
It is a 64-bit µP.
It has 2 physical cores.
Its clock speed is from 2.93 GHz
to 3.33 GHz.
It has 781 million transistors.
It has 64 KB of L1 cache per
core, 512 KB of L2 cache and 4
MB of L3 cache.
50
51. Microprocessor Features
51
•Low Cost - It uses integrated circuit technology reducing overall cost.
•High Speed - The microprocessor can work at very high speed. It can
execute millions of instructions per second.
•Small Size - It is small in size due to very less footprint but has a very
large scale and ultra large scale integration technology.
•Versatile - The same chip can be used for several applications, therefore,
microprocessors are versatile.
•Low Power Consumption - Microprocessors are using metal oxide
semiconductor technology, which consumes less power.
•Less Heat Generation - Microprocessors uses semiconductor technology
which will not emit much heat as compared to vacuum tube devices.
•Reliable - Since microprocessors use semiconductor technology,
therefore, the failure rate is very less. Hence it is very reliable.
•Portable - Due to the small size and low power consumption
microprocessors are portable.
52. Types of Microprocessor
52
• Complex Instruction Set Computers (CISC)
– have a large instruction set, with hardware support for a wide variety
of operations. In scientific, engineering, and mathematical operations
with hand coded assembly language (and some business applications
with hand coded assembly language), CISC processors usually
perform the most work in the shortest time.
– These types of processors are used in desktops, laptops and servers.
• Reduced Instruction Set Computers (RISC)
– have a small, compact instruction set. In most business applications
and in programs created by compilers from high level language
source, RISC processors usually perform the most work in the
shortest time.
– These types of processors are commonly used in ovens, air
conditioners, etc.
53. Types of Microprocessor
53
• Hybrid processors
– are some combination of CISC and RISC approaches,
attempting to balance the advantages of each
approach.
• Special purpose processors
– are optimized to perform specific functions. Digital
signal processors and various kinds of co-processors
are the most common kinds of special purpose
processors.
54. Types of Microprocessor
54
• Hybrid processors
– are some combination of CISC and RISC approaches,
attempting to balance the advantages of each
approach.
• Special purpose processors
– are optimized to perform specific functions. Digital
signal processors and various kinds of co-processors
are the most common kinds of special purpose
processors.
55. Advantages of Microprocessors
55
• High-speed processing
• Brings intelligence to the system
• Is flexible in nature
• Has a compact size
• Is easy to maintain
56. Disadvantages of Microprocessors
56
• Leads to overheating due to continuous
use.
• The data size decides the performance
• Larger than microcontrollers
• Doesn’t support floating-point operations
58. Microcontroller
When the MPU’s connected to memory and I/O device, the arrangement
becomes a MICROCOMPUTER.
When a computer are set on a single chip is called a Microcontroller (also
MCU or µC). It contains a processor core, memory, and programmable
input/output peripherals.
Block Diagram of a Microcomputer
59. History of Microcontroller
Intel 8048 was one of the first to use it in 1975.
EEPROM came out in 1993 boosting the use of
microcontrollers.
Atmel used flash memory in its microcontroller in
the same year.
61. Types of Microcontroller in Computer
8-bit Microcontroller
16-bit Microcontroller
32-bit Microcontroller
Embedded Microcontroller
External memory Microcontroller
62. Applications of Microcontroller
62
•Microcontroller-embedded systems:
Consumer electronics-toys, cameras, camcorders, and
robots
Consumers products-washing machines, microwave
ovens
Instrumentation-oscilloscope, medical equipment
Process control-data acquisition, and control
Communications-Telephone sets, cordless phones
Office equipment's-fax machines, printers, PABX
Emerging multimedia application-cellphones,
teleconferencing equipment's
Special purpose-DSP processors, switches, routers
63. Microprocessor vs Microcontroller
63
A microcontroller contains a processor core, memory, and
programmable input/output peripherals.
Microcontrollers include an integrated CPU, memory (a small amount
of RAM, program memory, or both) and peripherals capable of input
and output.
Microprocessor only contains a CPU (the kind used in a PC). In
addition to the usual arithmetic and logic elements of a general
purpose microprocessor,
The microprocessor includes some of the components on a chip and
other components are used as peripherals.
The microcontroller includes all of the required components on one
chip.
You can say that microcontroller = microprocessor + Motherboard
(memory & I/O) in one chip
68. – MIPS:
The performance of microprocessors are expressed in terms
of its Bandwidth (number of bits processed in a single
instruction)
Instruction set (set of instructions that can be executed) and
Clock-speed (number of executed-instructions per second)
Note that, bench marks are called MIPS (million instructions
per second)
– iCOMP index rate: The performance of 32 bit
microprocessors in personal computer measured based
on
Integer mathematics, floating point mathematics
Graphics and video
Widely used software applications
Performance of Microprocessors
70. Reprogrammable & Embedded Microprocessors
Microprocessors can be classified according to the type of
application:
Reprogrammable Microprocessors: It is used for general
applications such as personal computer and file server.
Embedded Microprocessors & Microcontrollers: Embedded µP
and µC are used to perform a dedicated control function event
Control like Industrial Process Control, Data Control like Hard
Disk Controller Interface-for example, to transfer data from
secondary memory to primary memory.
71. Reprogrammable & Embedded Microprocessors
Figure: Code and system-level compatibility.
8086/8088 microprocessor code can run on the 80286, 80386, 80486, and Pentium
processors, but reverse is not true.
Each new member of the 8086/8088 family provides a superset of the earlier device’s
architecture—that is, the features offered by the 80386 microprocessor are a superset of
the 80286 architecture, and those of the 80286 are a superset of the original 8086/8088
architecture.
The 80286, 80386, 80486, and Pentium processors can operate in either of two modes:
the real-address mode or protected-address mode
In real mode, the base instruction set such as object code is upward compatible within
the 8086 architecture. For this reason, operating systems and application programs
written for the 8086 and 8088 run on the 80286, 80386, 80486, and Pentium processor
architectures without modification.
72. What numbering System a
Microprocessor Uses?
72
For microprocessors and microcomputers, information
such as instructions, data, and addresses are described with
numbers such as binary and hexadecimal.
The on and off states of the capacitors in RAM can be
thought of as the values 1 and 0, respectively.
Therefore, thinking about how information is stored in
RAM requires knowledge of the binary (base 2) number
system.
Let’s review the decimal (base 10) number system first.
73. 73
The Decimal Number System
The decimal number system is a positional number system.
Since we use the digits 0 to 9 for decimal, the base or radix of this
number system is 10.
The value of a symbol depends on its location in the number, and
positional value of a digit is known as its weight.
5 6 2 1 1 X 100 = 1
103 102 101 100 2 X 101 = 20
6 X 102 = 600
5 X 103 = 5000
74. 74
The Binary Number System
The digital electronic devices and circuits in a microcomputer system
operate only in one of two states, on or off.
For this reason, binary numbers are used to describe the operation instead
of decimal number.
The base of the binary number system is 2. The values of the positions
are calculated by taking 2 to some power.
1 0 0 1 1 0 1
26 25 24 23 22 21 20
75. 75
Converting from Binary to Decimal
1 0 0 1 1 0 1 1 X 20 = 1
26 25 24 23 22 21 20 0 X 21 = 0
1 X 22 = 4
20 = 1 24 = 16 1 X 23 = 8
21 = 2 25 = 32 0 X 24 = 0
22 = 4 26 = 64 0 X 25 = 0
23 = 8 1 X 26 = 64
7710
76. 76
Converting from Binary to Decimal
Practice conversions:
Binary Decimal
11101 ?
1010101 ?
100111 ?
77. 77
Converting From Decimal to Binary
Make a list of the binary place values up to the number
being converted.
Perform successive divisions by 2, placing the
remainder of 0 or 1 in each of the positions from right
to left.
Continue until the quotient is zero.
Example: 4210
25 24 23 22 21 20
32 16 8 4 2 1
1 0 1 0 1 0
79. 79
Working with Large Numbers
0 1 0 1 0 0 0 0 1 0 1 0 0 1 1 1 = ?
• Humans can’t work well with binary numbers;
there are too many digits to deal with.
• Machine language programs, memory addresses
and other data can be quite large. Therefore, we
sometimes use the hexadecimal number
system.
80. 80
The Hexadecimal Number System
• The base of the hexadecimal number system is 16. The
values of the positions are calculated by taking 16 to
some power.
• Why is the base 16 for hexadecimal numbers ?
– Because we use 16 symbols, the digits 0 and 9 and
the letters A through F.
Binary Decimal Hexadecimal Binary Decimal Hexadecimal
0 0 0 1010 10 A
1 1 1 1011 11 B
10 2 2 1100 12 C
11 3 3 1101 13 D
100 4 4 1110 14 E
101 5 5 1111 15 F
110 6 6
111 7 7
1000 8 8
1001 9 9
81. 81
The Hexadecimal Number System
Example of a hexadecimal number and the values of the positions:
3 C 8 B 0 5 1
166 165 164 163 162 161 160
82. 82
Example of Equivalent Numbers
Binary: 1 0 1 0 0 0 0 1 0 1 0 0 1 1 12
Decimal: 2064710
Hexadecimal: 50A716
Notice how the number of digits gets smaller as
the base increases.
84. 84
Memory Definitions
• Memory ─ A collection of storage cells together with the
necessary circuits to transfer information to and from them.
• Memory Organization ─ the basic architectural structure
of a memory in terms of how data is accessed.
• Random Access Memory (RAM) ─ a memory organized
such that data can be transferred to or from any cell (or
collection of cells) in a time that is not dependent upon the
particular cell selected.
• Memory Address ─ A vector of bits that identifies a
particular memory element (or collection of elements).
85. Memory Terminology
◆ Memory Cell: circuit that stores 1-
bit of information
◆ Memory Word: 8 to 64 bits
◆ Byte: a group of 8 bits
◆ Capacity (=Density)
- 4096 20-bit words
= 81,920 bits = 4096*20 =
4K*20
◆ Address
◆ Read Operation (=fetch operation)
◆ Write Operation (=store operation)
8 memory words
86. Types of Semiconductor Memories
◆ Cache Memory:
Serves as a buffer for frequently accessed data
Small but high cost
◆ RAM – Random Access Memory
Stores programs and data that the computer needs when executing a
program.
Memory that can be both read and written during normal operation.
Contents are volatile, i.e.will be lost on power off.
Two types of RAM:
Static RAM
Fast access time (used for off-processor cache)
Does not have to be refreshed
Dynamic RAM
Slower access time
Must be refreshed
Much more dense
87. Types of Semiconductor Memories
◆ ROM – Read Only Memory
a type of memory that cannot be written, can only be read.
Contents determined a manufacture time.
◆ PROM – Programmable ROM
a type of memory whose contents can be programmed by the
use
OTP – One Time Programmable, a PROM is OTP if contents can
be programmed only once.
◆ EPROM-Erasable PROM
Can be programmed with special tool.
It has to be totally erased to be programmed.
◆ EEPROM-Electrically Erasable PROM
No special tools required.
Can erase a portion.
88. Memory Hierarchy
CPU registers hold words retrieved from L1 cache
L1 cache holds cache lines
retrieved from L2 cache
L2 cache holds cache lines
retrieved from main memory
Main memory hold disk blocks
retrieved from disks
Local disks hold files
retrieved from remote
storage
89. Connecting Memory to Processor
◆ Interconnection between
processor and memory is
through three sets of wires
known as buses
◆ Address bus establish the
location of memory
◆ Data bus carries the data
◆ Control bus determine read/
write operations etc.
Addr
Reg
Data
Reg
Memory
Up to 2k addressable
locations
Word length = n bits
K-bit
address bus
N-bit
data bus
Control lines
Read/Write
P
M
E
M
O
R
Y
Data [N-1:0]
Address [K-1:0]
CS
OE
WE
◆ Chip Select – must be asserted before Memory will
respond to read or write operation. If negated, data bus
is high impedance.
◆ OE – Output Enable: Asserted for read operation,
Memory will drive data lines.
◆ WE – Write Enable: Asserted for a write operation
(Memory inputs data from data pins, processor writes
to memory).
◆ There may only be one control line (R/W).
91. Main Memory Characteristics
◆ Most devices are 8-bits wide (Byte-addressable); some are 16-bits, others 1 bit
wide.
◆ Chip organisation examples: 1k x 8 (capacity = 8kb), 1G x 16 (16Gb)
Characteristics
◆ Access Times (read, write, erase)
The time from a valid address being placed on the address bus until valid
data appears on the data bus.
Faster is Better (varies from minutes to a few ns)
◆ Volatility
Ability to Retain Data After Power is Removed
◆ Power Consumption
Less is Better (mW to nW typical)
◆ Density
Larger is Better (bits/sq. transistors/bit)
◆ Cost
Less is Better
92. 92
Static RAM Cell
• Array of storage cells used to implement static RAM
• Storage Cell
– SR Latch
– Select input for
control
– Dual Rail Data
Inputs B and B
– Dual Rail Data
Outputs C and C
• select = 0 stored content is held, invalid output
• select = 1 content is changed by input or retrieved by output
• For m words with n bits per word we need an array of mn
binary storage cells
Select
B
RAM cell
C
C
B
S
R
Q
Q
93. 93
Dynamic RAM (DRAM)
• Basic Principle: Storage of information on
capacitors.
• Charge and discharge of capacitor changes the
stored value
• Use of transistor as “switch” to:
– Store charge
– Charge or discharge
• See next slide for circuit, hydraulic analogy, and
logical model.
94. 94
Dynamic RAM (DRAM)
In DRAM a bit is stored as the presence or
absence of charge on a capacitor
95. Static vs Dynamic RAM
Static RAM
◆ Fastest access time of all memory types. Typically the type of RAM used
primarily as cache.
◆ Read, Write operations take equal amounts of time.
◆ Access to any ‘random’location takes same amount of time.
◆ Basic memory cell is a latch (simple register), takes 6 transistors per
memory bit.
Dynamic RAM
◆ Must be refreshed within less than a millisecond
◆ Most main memory is dynamic RAM
◆ One transistor per memory cell (least expensive)
◆ SDRAM – Synchronous dynamic RAM – operates synchronously
with system clock and data bus. Can handle 100MHz to >800MHz.
◆ DDR – Double Data Rate – can transmit data on both edges of the clock
◆ QDR – Quad Data Rate – twice as fast as DDR
96. Flash Memory
◆ Hybrid of RAM/ROM
◆ Memory parts can be electrically erased and reprogrammed
without removing the chip.
◆ The entire chip (or block) must be erased at one time. Individual byte
erasure is not possible.
◆ Many uses, e.g. Solid State Disks (SSD), Compact Flash (CF), Smart
Media (SD cards), USB memory stick etc.
◆ Also embedded into microprocessors to make microcontrollers.
Pyboard contains 1MB of flash memory on the chip.
◆ Flash memory has limited erase cycles – need smart erase algorithm
with SSD drives.
◆ Write speed of flash memory usually is limited by erase speed – much
slower than RAM and DRAM, but much faster than hard disks.
97. Computer Languages
◆ Bit: a binary digit, 0 or 1.
◆ Byte: a group of eight bits.
◆ Nibble: a group of four bits.
◆ Word: a group of bits the computer recognizes and processes as a whole.
◆ Instruction: a command in binary that is recognized and executed by the
computer in order to accomplish a task. Some instructions are designed
with one word, and some require multiple words.
◆ Mnemonic: a combination of letters to suggest the operation of an
instruction. For example ADD A, B.
◆ Program: a set of instructions written in a specific sequence for the
computer to accomplish a given task.
◆ Machine language: the binary medium of communication with a
computer through a designed set of instructions specific to each computer.
◆ Assembly language: a medium of communication with a computer in
which programs are written in mnemonics. An assembly language is
specific to a given computer.
98. Computer Languages
◆ Low-level language: A medium of communication that is machine dependent, or
specific to a given computer. The machine and the assembly languages of a
computer are considered low-level languages. Program written in these languages
are not transferable to different types of machines.
◆ High-level language : A medium of communication independent of a given
computer. Programs are written in English –like words, and they can be executed
on a machine a machine using a translator (a compiler or an interpreter).
◆ Compiler: A program that translates English- like words of a high-level language
into the machine language of a computer. A compiler reads a given program, called
a source code, in its entirely and then translates the program into the machine
language, which is called an object code.
◆ Interpreter: A program that translates the English –like statements of a high level
language into the machine language of a computer. An interpreter translates one
statement at a time from a source code to an object code.
◆ Assembler: A computer program that translates an assembly language program
mnemonics to the binary machine code of a computer.