Micro - Lecture (CH 0)
Micro - Lecture (CH 0)
Micro - Lecture (CH 0)
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
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
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
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
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:
09/14/2023 14
Number systems &Codes
Complements in binary subtraction :
1. 2’s Complement:
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
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,…)
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