COMPUTER, MICROPROCESSOR AND 5.
Output Unit
MICROCONTROLLER ARCHITECTURE - devices used to transfer data and information
from the computer to the “outside world”.
2 branches of applications of microprocessor:
1. Personal Computer – intended to be versatile Arrows - indicate the direction in which data,
tools that could load and run various programs information, or control signals are flowing.
such as word processor, spreadsheets, database 1. Larger arrows – represent data or
and games. information that consists of large number of
2. Microcomputer (or Microcontroller unit) – parallel lines
control unit embedded in a marketable product. 2. Smaller arrows – represent control signals
This microcomputer is made up of the same that are normally only one or a few lines.
elements as the personal computer, but it is
programmed once by the manufacturer.
Intel 8051
- represent a branch of the microprocessor
family tree
- first developed in 1980s along with 68HCII
Digital computer
- is a combination of digital device and circuits
that can perform a
- sequence of operations with a minimum of
Computer Interfacing
human intervention.
- transmitting digital information between a
Program
computer and its peripherals in a
- sequence of operations
compatible/synchronized way.
- set of coded instructions that is stored in the
Peripherals
computer’s internal memory
- the devices that make up the input and output
Computer programmer
units because they are external to the rest of the
- provides a program of instructions and data
computer.
that specifies every detail of what to do, what to
Central Processing Unit
do it and when to do it.
- referred to simply as the central processor, but
more commonly called processor, the CPU
BASIC COMPUTER SYSTEM ORGANIZATION
- brain of the computer where most calculations
take place
Five essential elements in every computer:
1. Arithmetic/Logic Unit (ALU)
BASIC MICROCOMPUTER ELEMENTS
- which arithmetic and logic operations are
performed on data.
The difference between microcomputer and
2. Memory unit
microprocessor are:
- stores groups of binary digits that can
1. Microcomputer (or microcontroller) contains
represent instructions that the computer is to
several elements, the most important of which
perform and the data that are to be operated on
is the microprocessor.
by the program.
2. Microprocessor is usually a single IC that
3. Control Unit
contains all the circuitry of the control
- It directs the operation of all the other units by
and ALU-in other words, the CPU.
providing timing and control signals. It contains
logic and timing circuits that generate the
proper signals necessary to execute each
instruction in a program.
4. Input Unit
The three basic units of microcomputer:
- consists of all of the devices used to take
1. Memory unit
information and data that are external to the
2. Input/ output Unit
computer and put them into the memory unit
3. Microprocessor Unit (MPU) -the most important register that keeps track of
the addresses of the instruction codes as they
Memory unit – consist of RAM and ROM. are fetch from memory
RAM - consist of one or more LSI chips arranged
to provide the designed memory capacity. COMPUTER WORDS
ROM section – contains one or more ROM chips Bit - smallest unit if information in a computer
to store instructions and data that do not Word - a group of bits
change and must not be lost when power is shut Word size - number of bits that make word
off. 4, 8 or 16 bits - typical word size of embedded
microcontroller.
Input/output section – contain the interface 64 bits - word size of a current PC
circuits needed to allow the peripherals to Byte - a group of 8 bits
communicate properly - continues to be used as a unit to describe word
Input/output interface circuits –LSI chips size and memory capacity
designed by the MPU manufacturer to interface
the MPU to a variety of I/O devices. Types of Computer Words
MPU - heart of every microcomputer (or 1. Instructions
microcontroller) and computer. 2. Data - can be numerical or character
information that is to be processed by a program
Three basic sections of MPU: that the CPU is executing.
1. The control and timing section
2. The register section INSTRUCTION WORDS
3. The ALU section - contain the information necessary for a
computer to execute its operations
Timing and control section
- to fetch and decode instruction codes from Carry two basic units of information:
program memory and generate the necessary Operation code (op code) - represents the
control signals in order to carry out the operation that the computer is being instructed
execution of the instructions. to perform, such as addition, addition,
Register section subtraction, or moving data.
- Contains various registers, each of which Operand address - represents the location in
performs a special function. memory where the operand is stored. It tells
ALU Section computer where to get data.
- Performs a variety of arithmetic and logic
operations on data. These include addition, MULTIBYTE INSTRUCTION
subtraction, AND, OR, Ex-OR, shifting,
incrementing and decrementing. Three basic instruction formats:
1. Single - byte instruction
Other Types of Registers:
1. Instruction register (IR)- storing instruction
codes as they are being decoded
2. Accumulator (Acc)- holding data being 2. Two – byte instruction
operated on by the ALU. It stores one operand
for any math or logic instructions
3. Data pointer (DTPR)- storing addresses of
data to be fetched from memory
4. R0 – R7 - other general purpose storage and 3. Three - byte instruction
counting functions
Program Counter
Purpose:
Byte one – for the op code (instruction such as
add, move, etc.) TYPICAL MICROCOMPUTER STRUCTURE
Byte two – for the data value
Byte three – operand address Write operation
- when CPU sending data to another computer
Addressing mode – mode of specifying data. and CPU is writing into selected element.
Six addressing mode: Read operation
1. Direct addressing mode - when the CPU is receiving data from another
2. Immediate addressing mode element and the CPU is reading from the
3. Extended addressing mode selected element.
4. Indexed addressing mode Bus system
5. Indirect addressing mode - carry all of the information and signals involved
6. Relative addressing mode in the system operation.
Timing
EXECUTING A MACHINE – LANGUAGE - generates the basic clock signal to time all of its
PROGRAM operation
Machine language Three buses:
- the instruction words that are represented by 1. Address bus - a unidirectional bus, from
1s and 0s, the only language that the machine CPU to the memory or I/O elements that carry
can understand. memory addresses/location
2. Data bus - a bidirectional bus, from or to CPU
that carry various data
Mnemonic 3. Control bus - a set of signals that is used to
- abbreviation of instructions for easier to synchronize the activities of the separate
remember than op code. microcomputer elements/units
High level language
- these are languages design to make it easy for Two types of cycles:
man to write a program. 1. Machine cycle – all operations of the system,
Compiler such as fetching and executing
- a software or program that converts high-level instructions, reading and writing data, fit exactly
language into machine language into periods
Assembly language 1 machine cycle = 12 clock cycle = 1
- the complete set of mnemonics for a computer microseconds at 12 MHz
instruction set 2. Bus cycle – timing that takes place in a bus
system
PROGRAM EXECUTION
3 distinct type of bus cycle:
2 kinds of operating cycles:
Bus Cycle Control Signal Data Transferred
1. Fetch cycle – during which the control unit
fetches the instruction codes (op code and Fetch PSEN’ CPU ← program
operand address) from memory Cycle memory
2. Execute cycle – during which the control unit Data Read RD’ CPU ← I/O or
performs the operation called for by the Cycle data memory
op code. Data Write WR’ CPU → I/O or
Cycle data memory
Reset
- operation starts here when activated by
applying power. This will initialize a program
counter (PC) to a starting count of 0000.
Recall: Program counter
- a counter within the control unit that keeps TYPES OF COMPUTER:
track of the program addresses as the computer 1. Main-frame computers
sequences through them.
- one computer serving a variety of needs within
one business REGISTERS
Data Registers
2. Minicomputers - where data can be manipulated by arithmetic
- slightly less computing power and and logical instructions
data storage than main-frames, -fast, do not require reference to data held in
- much cheaper and could be operated in external memory registers.
ordinary rooms. - Accumulator A and Accumulator B.
Address Registers
3. Microcomputer - use in data movement instructions.
- advent of the microprocessor in 1971 - Index Register X and Index Register Y.
- A small, general-purpose processing board that
could be used in other applications. Program Counter
- keeps track of where the processor is in a
4. Personal computer program.
- general-purpose computer equipped with a - stores the address of the next instruction
microprocessor which is to be executed.
- designed to run for an individual user.
FUNDAMENTALS OF MICROPROCESSOR Instruction Register
- holds the binary instruction word while it is
ALU - The Arithmetic and Logic Unit (ALU) being executed in the processor.
comprises circuitry to perform arithmetic and Temporary registers
logical operations, such as ADD, SUBTRACT, AND, - to hold transitory data while an instruction is
OR, SHIFT. being carried out.
REGISTERS - A register is a temporary (internal)
storage element. This will typically hold an 8 or
16-bit operand.
BUS - A bus is a parallel set of wires
(metallization or conductive silicon
internally to a chip) which carries information.
ACCUMULATOR
- derived from this function of accumulating
results.
- result is stored in the accumulator, overwriting
any previous data.
Sequence to add two 8-bit numbers: BUSES
1. Load accumulator with operand A. Address Bus
2. Fetch data operand B. - Connects the processor to memory devices and
3. Add A and B in the adder and store the interfaces.
result in the accumulator. - used by to indicate which memory register (or
interface register) is the source or destination
ALU (Arithmetic Logic Unit) Capabilities: for data
Performs a variety of operations, not
just adding or AND operations. Data Bus
Requires programming or function - used to transfer data between the processor
select inputs in addition to data inputs. and memory registers and interface registers.
Example ALU:
74HC181: A 4 + 4 bits ALU with 32 Byte Ordering
programmable functions, part of the 74 - refers to the order in which bytes of multi-byte
series logic family. data are stored.
Little-Endian: ★Intel 4004 (1971): First microprocessor,
- Lowest (least significant) byte stored first at the developed by Federico Faggin, Ted Hoff, and
smallest address. Stan Mazor.
- Used by Intel/AMD x86, Digital VAX, Digital
Alpha.
Microprocessor Evolution
Big-Endian:
- Highest (most significant) byte stored first at ★8080 (1973): First general-purpose 8-bit
the smallest address. microprocessor.
- Used by IBM mainframes, Motorola 680x0, Sun
SPARC, PowerPC, most RISC machines. ★8085 (1977): Enhanced version of 8080 with
better efficiency.
★8086 & 8088 (1978-79): First 16-bit processors
with 1MB memory addressing.
★80286 (1983): Introduced protected mode and
16MB memory addressing.
★80386 (1986): First 32-bit microprocessor,
capable of addressing 4GB memory.
80386EX (1995): Called an embedded PC
★80486 (1989): Integrated math coprocessor,
History of Computers cache memory.
★Blaise Pascal (1642): Invented a mechanical ★Pentium Series (1993-present): Introduction of
calculator with gears and wheels.
superscalar architecture, multiple cores, and 64-
★Charles Babbage (1823): Developed the bit processing.
Analytical Engine, a steam-powered mechanical
★Pentium (1993): First superscalar architecture
computer.
(executed multiple instructions per cycle).
★Herman Hollerith (1889): Developed punched
★Pentium Pro (1995): Optimized for 32-bit
card data storage and mechanical tabulating
applications, used in servers. Formerly named
machines.
the P6.
★Joseph Jacquard: punched card;
★Pentium II (1997): Enhanced multimedia
weaving machine; frenchman
processing with MMX technology.
★Konrad Zuse (1941): Invented the Z3, the first
electromechanical computer. ★Pentium Xeon Microprocessors (mid-1998):
Specifically designed for high-end workstation
★Alan Turing (1943-1944): Developed the and server applications
Colossus, an electronic code-breaking machine.
★Pentium III (1999): Improved performance
★ENIAC “Electronic Numerical Integrator and with SSE (Streaming SIMD Extensions).
Computer”
★Pentium 4 (2000): Introduced Hyper-
(1946): First general-purpose electronic Threading for better multitasking.
computer with 17,000 vacuum tubes.
Core2 Microprocessors: Available at speeds of
★Invention of Transistor (1947): John Bardeen, up to 3 GHz.
William Shockley, and Walter Brattain developed
the transistor, leading to modern Microprocessor-Based Personal Computer
microprocessors. System
★I/O Devices: Keyboard, mouse, printer, storage
devices.
Block Diagram of a Computer System
★Address Bus: Determines memory/I/O
Components
location.
★Data Bus: Transfers data between
components.
★Control Bus: Manages operations of memory
and I/O
devices.
★Microprocessor (CPU): Processes instructions Microprocessor Architecture and Functionality
and controls system operations.
Basic Functions of a Microprocessor
★Memory System: Stores data and instructions.
★Data Transfer: Between microprocessor,
ROM- retains data when shutdown memory, and I/O.
RAM- erased when power off ★Arithmetic and Logic Operations: Performs
★I/O Devices: Interfaces for user input/output. mathematical
★Buses: Data, address, and control buses for and logical computations.
communication. ★Program Execution: Fetches and executes
stored
Memory Systems
instructions.
★Real Memory System (First 1MB): Used in
early IBM PCs, ★Decision Making: Uses conditional operations
to modify
supported by all Intel microprocessors.
program flow.
★Extended Memory System (Above 1MB):
Introduced in Types of Microprocessors
80286 and later processors. ★CISC (Complex Instruction Set Computer):
Large instruction
Types of Memory
sets, optimized for complex operations (e.g.,
★TPA (Transient Program Area): Holds OS, Intel x86
drivers, and
processors).
active applications.
★RISC (Reduced Instruction Set Computer):
★System Area: Stores BIOS, video memory, and Simplified
system
instructions, optimized for speed (e.g., ARM,
configuration data. PowerPC).
★Extended Memory (XMS): Used in advanced Programming and Software Development
OS like
Programming Languages Evolution
Windows.
★Machine Language: Binary code (0s and 1s)
I/O System and Bus Structure executed by
microprocessor.
★Assembly Language: Uses mnemonic codes ★Used in high-end servers and scientific
(e.g., ADD, computing.
MOV) instead of binary.
High-Level Languages ★A computer is a programmable machine that:
- Receives input - Stores and manipulates data -
★FORTRAN (1957): First high-level programming
Provides output
language.
Basic Components: - CPU (Central Processing
★COBOL (1959): Used for business applications.
Unit) - Memory (RAM, ROM) - Input and Output
★BASIC, C, C++, Java, Python: Modern (I/O) Unit
languages for
★Control Unit
various applications.
Bus System: - Address bus - Data bus - Control
Software Development in Microprocessors bus
★Assembler: Converts assembly code to Basic Components of a Microcomputer
machine code.
Central Processing Unit (CPU) - Executes
★Compiler: Translates high-level language to program instructions - Controls the computer's
machine code. operations - Includes: - Arithmetic and Logic Unit
(ALU) - Control Unit - Register sets
★Operating Systems: Manage system resources
and hardware interactions (e.g., DOS, Windows, Memory - RAM (Random Access Memory):
Linux). Stores data temporarily - ROM (Read-Only
Memory): Stores permanent instructions - BIOS
(Basic Input/Output System): Controls startup
Modern and Future Microprocessor Trends operations
Recent Microprocessor Advancements I/O Unit - Communication between the
★Multi-Core Processors: Improves processing computer and external devices - Input Devices:
power and efficiency (e.g., Intel Core i9, AMD Keyboard, Mouse - Output Devices: Monitor,
Ryzen). Printer - Storage Devices: Hard disk, Optical disk,
USB
★64-bit Architecture: Supports larger memory
addressing and improved performance. Data Sizes - Nibble: 4-bit - Byte: 8-bit - Word: 16-
bit - Long Word: 32-bit
★AI and Neural Processing Units (NPUs):
Enhancing computing for AI-driven applications. Internal Structure of a Microprocessor
★Quantum Computing: Future of computing ★Arithmetic and Logic Unit (ALU) - Performs
with qubits replacing traditional bits. arithmetic operations (addition, subtraction) -
Executes logical operations (AND, OR, NOT) -
Intel Itanium and EPIC Architecture Directs operations inside the processor -
Manages execution of instructions
★Itanium (2002): Introduced Explicitly Parallel
Instruction Computing (EPIC). ★Register Sets - Temporary data storage inside
the CPU - More registers = Better performance
Key Features
Types: - General Purpose Registers: Store
★128-bit architecture.
temporary data - Special Purpose Registers: PC,
★Advanced parallel execution capabilities. SP, CCR
★Accumulator - Stores intermediate results of ★Zilog Z80: Widely used in early computers
calculations
★Condition Code Register (CCR)
Stores status flags:
ᅳ Z (Zero Flag): Indicates zero result
ᅳ C (Carry Flag): Shows overflow in operations
ᅳ N (Negative/Sign Flag): Indicates negative
result
ᅳ V (Overflow Flag): Shows signed number
overflow
ᅳ I (Interrupt Flag): Interrupts can be controlled
by setting
or clearing a flag, but modifying it may be
restricted to
supervisor mode.
★Program Counter (PC) - Holds the address of
the next instruction - Increments automatically
after execution
★Stack Pointer (SP) - Stores addresses during
function calls and interrupts - Operates in Last-
In-First-Out (LIFO) manner
★Bus System
Data Bus - Bi-directional - Transfers data
between CPU, memory, and I/O devices - Can
handle 8-bit or 16-bit data
Address Bus - Unidirectional - Specifies memory
locations - The width determines the number of
accessible memory
locations
Control Bus - Sends control and timing signals -
Synchronizes CPU operations with memory and
peripherals
Microprocessor Clock - Determines the speed of
instruction execution - Regulates timing of all
system components - Measured in Hertz (Hz) or
Megahertz (MHz)
Examples of Microprocessors
★Intel 8086: First 16-bit microprocessor
★Motorola 6800: 8-bit microprocessor