Micro - Lecture (CH 0)

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 38

Microprocessor

Presented by
Dr. Mohammed Alolofi

09/14/2023 1
Introduction
 Course Topics:
 Review of Intel and Motorola Microprocessors.
 Review of Intel Generations of Microprocessors 85 and 86- Family.
 IBM - Personal Computer. Architecture of 85 and 86- Family Microprocessors, The Component
of IBM Micro Computer Systems, Memory-Central Processing Units, I/O Ports.
 Assembly language: Introduction to Assembly language, Instruction Set. Data Transfer,
Arithmetic Operations, Logical Operations , Transfer of Control, Stack Memory, Addressing
Modes, Applied Assembly Programming, and Macros.
 Microcontroller 8051 and Embedded Systems.

 Simulation software:
 Emulator
 Turbo Assembler (TASM), Debugging and Program Tracing.
 Microsoft Assembler (MASM).
 Proteus 7.
 Others .
09/14/2023 2
Introduction

09/14/2023 3
Introduction

09/14/2023 4
Introduction

Chapter (0): Introduction to Computing


 Numbering & Coding Systems
 Internal Organization of Computer

09/14/2023 5
Numbering &Coding Systems
 Human beings use base 10 (decimal system) arithmetic
 Decimal System: is composed of 10 numbers (0,1,2,3,4,5,6,7,8,9).
 Computer use base 2 (Binary System): is composed of 2 binary digits
(0,1).
 These two binary digits are commonly referred to as bits
 For example: (0011)2 = (3)10
 Hexadecimal System: is composed of 10 numbers
{0,1,2,3,4,5,6,7,8,9} and 6 letters (A,B,C,D,E,F), Also called base-16
system.

09/14/2023 6
Numbering &Coding Systems
 Ternary System: is composed of 3 numbers {0,1,2}, Also called base-3
system.
 Quaternary System: is composed of 4 numbers {0,1,2,3}, Also called
base-4 system.
 Octal System: is composed of 8 numbers {0,1,2,3,4,5,6,7}, Also called
base-8 system.

09/14/2023 7
Numbering &Coding Systems
 Converting from Decimal to Binary:
1. Divide the decimal number by 2 repeatedly
2. Keep track of the remainders
3. Continue this process until the quotient becomes zero
4. Write the remainders in reverse order to obtain the binary number

09/14/2023 8
Numbering &Coding Systems
 Converting from Binary to Decimal:
1. Know the weight of each bit in a binary number
2. Add them together to get its decimal equivalent

 Use the concept of weight to convert a decimal number to a binary directly

09/14/2023 9
Numbering &Coding Systems
 Hexadecimal System:
 is used as a convenient representation
of binary numbers
 It is much easier to represent a string of
0s and 1s such as 100010010110 as its

hexadecimal equivalent of 896H

09/14/2023 10
Numbering &Coding Systems
 Converting from Binary to Hex:
1. Start from the right and group 4 bits at a time,
2. replacing each 4-bit binary number with its hex equivalent

 Converting from Hex to Binary:


1. Each hex digit is replaced with its 4-bit binary equivalent

09/14/2023 11
Numbering &Coding Systems
 Converting from Decimal to Hex: two methods
1. Convert to binary first and then convert to hex
2. Convert directly from decimal to hex by repeated division, keeping track of
the remainders

09/14/2023 12
Numbering &Coding Systems
 Converting from Hex to Decimal: two methods
1. Convert to binary first and then convert to decimal
2. Convert directly from hex to decimal by summing the weight of all digits

09/14/2023 13
Numbering &Coding Systems
 Addition of Binary numbers:

 Subtraction of Binary numbers:


 Using 1’s Complement and 2’s Complement to simplify binary subtraction.

09/14/2023 14
Number systems &Codes
 Complements in binary subtraction :
1. 2’s Complement:

If find extra bit in result, neglect


If no find extra bit in result, then
extra bit and then
M-N = - (2’s Comp(result))
M-N = Result without extra number

2. 1’s Complement:

If find extra bit in result, then add If no find extra bit in result, M-N = -
extra bit to LSB bit in the result (1’s Comp(result))

09/14/2023 15
Numbering &Coding Systems
 Addition of Hex numbers: Adding the digits together from the least
significant digits.
 If the result is less than 16, write that digit as the sum for that position
 If it is greater than 16, subtract 16 from it to get the digit and carry 1 to the
next digit

09/14/2023 16
Numbering &Coding Systems
 Subtraction of Hex numbers: Subtract the digits together from the
least significant digits.
 If the second digit is greater than the first, borrow 16 from the
preceding digit

09/14/2023 17
Numbering &Coding Systems
 ASCII Code: (American Standard Code for Information Interchange)
 Since all information in computer must be represented by 0 and 1, binary
pattern must be assigned to the letters and other characters.
 In the 1960 ASCII code was established.
 The ASCII (pronounced “ask-E”) code assigns binary patterns for
1. Numbers 0 to 9,
2. All the letters of English alphabet, uppercase and lowercase
3. Many control codes and punctuation marks
 The ASCII system uses 7 bits to represent each code, for example, 100 0001 is
assigned the “A”, and 110 0001 is assigned the “a”.
 The pattern of ASCII codes was designed to allow for easy manipulation of
ASCII data. For example, digits 0 through 9 are represented by ASCII codes 30
through 39.
09/14/2023 18
Numbering &Coding Systems
 ASCII Code: (American Standard Code for Information Interchange)

09/14/2023 19
Inside the Computer
 Important terminology:
 The unit of data size:
 Bit : a binary digit (0 or 1)
 Nibble : half of a byte, or 4 bits
 Byte : 8 bits
 Word : two bytes, or 16 bits

 The terms used to describe amounts of memory in computer:


 Kilobyte (K): 210 bytes = 1024 bytes
 Megabyte (M) : 220 bytes, over 1 million = 1,048,576 bytes
 Gigabyte (G) : 230 bytes, over 1 billion
 Terabyte (T) : 240 bytes, over 1 trillion
09/14/2023 20
Inside the Computer
 Internal Organization of Computers:
 The internal working of every computer can be broken down into
three parts:
1. CPU
2. I/O devices
3. Memory

 CPU (Central Processing Unit):


 Execute (process) information stored in memory

 I/O (Input/output) devices:


 (Such as a keyboard and video monitor) Provide a means of communicating
with CPU.
09/14/2023 21
Inside the Computer
 Internal Organization of Computers:
 Memory: two types
I. RAM (Random Access Memory) : sometimes called (Read/Write Memory)
 Used by the computer for temporary storage of programs that it is running
 The data is lost when computer is off. It is called volatile memory
II. ROM (Read Only Memory) :
 Contains programs and information essential to operation of the computer
 The information cannot be changed by user, and is not lost when power is
off. It is called nonvolatile memory
 The CPU is connected to memory and I/O through strips of wire called a
bus (Carries information from place to place).
1. Address bus
2. Data bus
09/14/2023 3. Control bus 22
Inside the Computer
 Internal Organization of Computers:

09/14/2023 23
Inside the Computer
 Internal Organization of Computers:

09/14/2023 24
Inside the Computer
 Internal Organization of Computers:
 Address bus
 For a device (memory or I/O) to be recognized by the CPU,
it must be assigned an address
 The address assigned to a given device must be unique
 The CPU puts the address on the address bus, and the
decoding circuitry finds the device
 Data bus
 The CPU either gets data from the device or sends data to it
 Control bus
 Provides read or write signals to the device to indicate if
the CPU is asking for information or sending it information
 The address bus and data bus determine the capability of the
given CPU.
09/14/2023 25
Inside the Computer
 Data Buses:
 The more data buses available, the better the CPU
 Think of data buses as highway lanes
 More lanes provide a better pathway between the CPU and external
devices (RAM, ROM, printers,…)

 More data buses mean a more expensive CPU and computer


 The average size of data buses in CPUs varies between 8-bits and 64-bits.

 Data buses are bidirectional


 To receive or send data
 The processing power of a computer is related to the size of its
buses. A 8-bits bus can send out 1 byte, a 16-bits can send 2
bytes.
09/14/2023 26
Inside the Computer
 Address Buses:
 The more address buses available, the larger the number of
devices that can be addressed
 The number of locations with which a CPU can communicate is
always equal to 2x, where x is the address lines, regardless of
the size of the data bus
 ex. a CPU with 24 address lines and 16 data lines can provide a total of
224 or 16 Mbytes of addressable memory
 Each location can have a maximum of 1 byte of data, since all general-
purpose CPUs are byte addressable

 The address bus is unidirectional


09/14/2023 27
Inside the Computer
 Relation between CPU & ROM, RAM:
 For the CPU to process information, the data must be stored in
RAM or ROM, which are referred to as primary memory
 ROM provides information that is fixed and permanent
 Tables of charc. Patterns or initialization programs
 RAM stores information that is not permanent and can change
with time
 Various application packages
 CPU gets information to be processed first from RAM (or ROM)
 if it is not there, then seeks it from a mass storage device,
called secondary memory, and transfers the information to
RAM
09/14/2023 28
Inside the Computer
 Inside the CPU:

09/14/2023 29
Inside the Computer
 Inside the CPU:
 Registers
 The CPU uses registers to store information temporarily
 Two Values to be processed
 Address of value to be fetched from memory
 In general, the more and bigger the registers, the better the
CPU
 Registers can be 8-, 16-, 32-, or 64-bit
 The disadvantage of more and bigger registers is the
increased cost of such a CPU
 ALU (Arithmetic/Logic Unit)
 Performs arithmetic functions such as add, subtract, multiply, and
divide, and logic functions such as AND, OR, and NOT.
09/14/2023 30
Inside the Computer
 Inside the CPU:
 Program counter
 Points to the address of the next instruction to be executed
 As each instruction is executed, the program counter is incremented
to point to the address of the next instruction to be executed.

 Instruction decoder
 Interprets the instruction fetched into the CPU
 A CPU capable of understanding more instructions requires more
transistors to design

09/14/2023 31
Inside the Computer
 Internal Working of Computers:

09/14/2023 32
Inside the Computer
 Internal Working of Computers:

09/14/2023 33
Inside the Computer
 Internal Working of Computers:

09/14/2023 34
Inside the Computer
 Internal Working of Computers:

09/14/2023 35
Inside the Computer
 Internal Working of Computers:

09/14/2023 36
Inside the Computer
 Internal Working of Computers:

09/14/2023 37
Any Question?

09/14/2023 38

You might also like