MICROCONTROLLER
ECT282
MODULE 1
• Functional units of a computer ,Von Neumann and Harvard computer
architectures ,Processor Architecture-General internal architecture, Address
bus, Data bus, control bus, Register set-status register,accumulator,program
counter, stack pointer, general purpose registers, Processor operation-
instruction cycle,instruction fetch , instruction decode , instruction execute.
Functional units of a computer
Computer Architecture
• A computer system is organized into several key components that work
together to perform operations. These components are based on the Von
Neumann architecture, which includes the CPU, memory, input/output
devices, and interconnections. Here is a detailed explanation of the core
components:
Mainly consist of
• The Central Processing Unit (CPU)
• The Main Memory Unit
• The Input/Output Unit
CPU
• CPU [Central Processing Unit]. It is the brain of the computer. It is the part
that does most of the work in a computer system
• A CPU is hardware that performs data input/output, processing, and storage
functions for a computer system.
• A CPU can be installed into a CPU socket. These sockets are generally
located on the motherboard.
• CPU can perform various data processing operations.
• CPU can store data, instructions, programs, and intermediate results
• CPU Consist of
1. Control Unit(CU):A control unit (CU) handles all processor control
signals. It directs all input and output flow, fetches code for instructions,
and controls how data moves around the system.
2. Arithmetic and Logic Unit(ALU):Performs arithmetic (addition,
subtraction, multiplication) and logical operations (comparisons, AND,
OR).
3. Variety of Registers:Small, fast storage locations inside the CPU that
temporarily hold data and instructions during
processing.Eg.Accumulator,ProgramCounter,InstructionRegister,MemoryA
ddress Register ,Memory data register
Main Functions of a CPU:
• Fetch: Retrieves an instruction from the memory.
• Decode: Translates the instruction into a format that can be executed.
• Execute: Carries out the instruction, such as performing a calculation or
moving data.
• Store: Saves the result to memory if needed
Classification of CPUs Based on the Number of Processing Units
• CPUs can be classified based on the number of processing units or cores. Each core can
execute instructions independently, allowing for better multitasking and performance. They
are
1. Single-Core CPU: A single-core CPU has one processing unit(core). It can only execute one
instruction at a time. While it is suitable for basic tasks like browsing the web or word
processing ,it struggles with multitasking or running multiple heavy applications simultaneously.
2. Dual-Core CPU: A dual-core CPU has two processing units (cores).It can execute two
instructions simultaneously, allowing for better multitasking and improved performance over a
single-core processor. This type of CPU is ideal for moderate multitasking and handling more
demanding tasks like casual gaming or video streaming.
3. Multi-CoreCPU: A multi-core CPU has more than two processing units,such as
fourcores(quad-core), six cores (hexa-core),or eight cores (octa-core). These CPUs can handle
multiple tasks at once,making them ideal for heavy multitasking, gaming,video editing, and
other resource-intensive tasks. The more cores a CPU has,the better it can manage complex
workloads.
Memory
Memory in computing refers to the system components, devices, and media that store data and
instructions for processing by the CPU.
It is essential for holding both the programs being executed and the data they operate on.
There are two main types of memory:
Primary Memory
• Primary memory also known as “main memory” or “internal memory” which is located
in the mother board of system This includes memory that is directly accessible by the CPU,
such as RAM (Random Access Memory), ROM (Read Only Memory) and Cache Memory
Secondary Memory
• This includes storage devices such as Hard Drives (HDD) Magnetic tapes , Solid State
Drives (SSD) SSD), and optical drives
Differences
RAM
• RAM also known as “Random Access Memory”.
• It stores the data which the user currently uses or as we say it stores the data
temporarily in it.
• RAM needs power or electricity to work .When the computer power is
turned off,then all the data in it will be erased automatically.
• This is a circuit which have its separate space or slot in motherboard.
Dynamic RAM(DRAM)
• Uses capacitors for storing bits as electric charge.
• Each bit of data is stored in a single capacitor, and the charge can leak away
over time.
• Needs to be refreshed thousands of times per second
• DRAM works slower than SRAM. Mostly used because it is much cheaper
than SRAM and requires less space.
• Eg: DDR1,DDR2,DDR3,etc..
Static RAM(SRAM)
• SRAM stores data using flip-flops, which are circuits made up of multiple
transistors. Each bit of data requires a separate flip-flop.
• SRAM is faster than DRAM because it does not need to be refreshed and
can provide immediate access to stored data.
• Requires less power than dynamic RAM but is much more expensive.
• Used for CPU cache memory
ROM (Read Only Memory)
ROM(Read Only Memory) is a type of non volatile memory, it retains its data even when
the power is turned off unlike RAM(Random Access Memory), which is used for temporary
storage
ROM is used to store permanent or semi permanent data, such as firmware or software that
doesn't change often
Mainly there are three types of ROM
ROM
EPROM
EEPROM
PROM (Programmable ROM):
• PROM is a type of ROM that can be programmed once after manufacturing.
• It is blank when created,and data can be written to it by a special device
(PROM programmer).
• Used for applications where data doesn't need to be modified frequently
EPROM (Erasable Programmable ROM)
• EPROM can be erased and reprogrammed. It uses ultraviolet light to erase
the data and then can be rewritten with new data.
• Often used in applications where data might need to be updated, but not
very frequently (e.g., in embedded systems or early computer BIOS).
EEPROM (Electrically Erasable
Programmable ROM)
• EEPROM can be erased and reprogrammed electrically (without needing
UV light like EPROM). It can be rewritten multiple times, but not as quickly
as regular RAM.
• Used in situations where small amounts of data need to be stored or
updated, like in microcontrollers, configuration settings, and some types of
firmware.
Secondary Memory
• Refers to storage devices that are used to store data permanently outside of
the computer's primary memory
• Unlike primary memory, which is fast and temporary
• Secondary memory is slower but provides large storage capacity
• Secondary memory is non volatile, meaning it retains data even when the
power is turned off
• Examples of secondary memory include:
Hard Disk Drives (HDDs)
Solid-State Drives (SSDs)
Optical Discs (CDs, DVDs)
Magnetic Tapes
Harvard architecture
Harvard architecture – diagram
Von-Neumann architecture
Firmware
Firmware is software that's embedded in hardware to control how it functions. It's also known as "software for hardware".
How does firmware works?
Firmware runs when a device is turned on
It sends instructions to the device's processor
It helps the device interact with other devices, like routers and remote controls
It executes input/output (I/O) tasks
Where is firmware found?
Firmware is found in many devices, including smartphones, smart home devices, TVs, cameras, and industrial equipment
It's typically stored in non-volatile memory, like read-only memory (ROM) or programmable memory (PROM) chips
Types of firmware
Low-level firmware: An intrinsic part of a device's hardware that's often stored on ROM
High-level firmware: More complex than low-level firmware and can be updated
Subsystem firmware: Often part of an embedded system, like a CPU or liquid-crystal display
Unified Extensible Firmware Interface (UEFI): An advanced type of system firmware that runs on newer computer systems
Updating firmware
Firmware can be updated to fix problems, add features, or increase compatibility .
Buses
• A bus is a set of physical connections (cables,circuits,etc.) that can be shared
by multiple hardware components to communicate with one another.
• Memory and input/output devices areconnected to the Central Processing
Unit through a group of lines called a bus. These lines are designed to
transfer data between different components.
• Types of Computer Bus
• Address Bus
• Data Bus
• Control Bus
Address Bus
• It carries the addresses of memory locations to be accessed by the CPU
• It tells the system where data should be read from or written to in memory.
• The address bus is unidirectional, meaning data flows in one direction: from the
CPU to the memory.
• Width:The width of the address bus (i.e., the number of lines it has) determines
how much memory or how many devices can be addressed. For example:
• A 16-bit address bus can address 2^16 = 65,536 locations.
• A 32-bit address bus can address 2^32 = 4,294,967,296 locations
Data Bus
• The data bus is responsible for the actual transfer of data between the CPU,
memory, and peripheral devices. It carries the data that the system reads from or
writes to memory or I/O devices
• The data bus is bidirectional, meaning data can flow in both directions: from the
CPU to memory or I/O devices, or from memory or I/O devices to the CPU.
• Width:The width of the data bus (number of lines) determines how much data can
be transferred at once. A wider data bus allows more data to be transferred
simultaneously, improving the overall system performance.
• For example, a 32-bit data bus can transfer 32 bits of data in one cycle.
Control Bus
It carries control signals that manage and synchronize the operations of the CPU,
memory, and peripheral devices. These signals ensure that the correct operation
(read, write, fetch, etc.) is carried out at the appropriate time.
The control bus is unidirectional in most cases, but it can also be bidirectional
depending on the system design.
Types of Control Signals:
Read/Write Signal:Indicates whether the operation is a read or a write.
Clock Signal:Synchronizes the timing of operations.
Interrupt Signals:Notify the CPU of external events requiring attention.
Memory or I/O Signals:Specify whether the operation is being performed on memory or
I/O devices.
Status Signals:Provide status information, such as ready or busy states of a device.