Chapter One Embedded System
Chapter One Embedded System
1
Chapter 1: Introduction to digital
logic
• 1.1 Logic algebra
Outline • 1.2 Logic circuits
• 1.3 Logic devices such as counters,
timers and finite state machines
2
Chapter 1: Introduction to digital logic
➢Digital logic forms the fundamental building blocks of embedded systems,
providing the basis for the design and implementation of intelligent and
controlled functionalities.
➢Understanding digital logic is crucial for software engineers working on
embedded systems, as it lays the foundation for efficient information
processing, decision-making, and interfacing with the physical world.
➢ Digital logic is the language through which embedded systems
communicate and process information.
➢Its principles are integral to both hardware and software aspects of
embedded system design, making it a fundamental area of study for
software engineers working in this field.
3
1.1 Logic algebra
➢ Logic algebra, also known as Boolean algebra, is a
mathematical structure and set of operations that deals with
binary variables and logic operations.
➢ It plays a fundamental role in the design and analysis of digital
circuits, computer systems, and electronic devices.
➢The algebraic rules of logic algebra are based on the work of
mathematician and logician George Boole.
4
Logic algebra…
➢ Key Concepts:
1. Binary Variables: In logic algebra, variables can only take on one of two values: 0
or 1. These values represent the absence (0) or presence (1) of a logical condition.
2. Logical Operations: Logic algebra includes several fundamental logical operations,
each with specific rules and symbols
❑ AND (Conjunction): denoted by ∧ or ·
• Represents the logical product. The result is 1 only if both operands are 1.
❑ OR (Disjunction): denoted by + or ∨
• Represents the logical sum. The result is 1 if at least one operand is 1.
❑ NOT (Negation): denoted by ¬ or '
• Represents the logical complement. Flips the value of the operand (1
becomes 0, and 0 becomes 1). 5
Logic algebra…
3. Boolean Expressions: Boolean expressions are combinations of binary
variables and logical operations.
➢They can be used to represent and analyse the behaviour of digital circuits
and systems.
4. Truth Tables: Truth tables are used to represent the output of a Boolean
expression for all possible combinations of input values.
6
Logic algebra…
➢ Basic Laws of Logic Algebra: 4. Commutative Laws:
1. Identity Laws: • A+B=B+A
• A⋅B=B⋅A
• A+0=A
5. Associative Laws:
• A⋅1=A
• (A+B)+C=A+(B+C)
2.Domination Laws: • (A⋅B)⋅C=A⋅(B⋅C)
• 1A+A′=1 6. Distributive Laws:
• 0A⋅A′=0 • A⋅(B+C)=(A⋅B)+(A⋅C)
• A+(B⋅C)=(A+B)⋅(A+C)
3. Idempotent Laws: 7. De Morgan's Laws:
• A+A=A • (A+B)′=A′⋅B′
• A⋅A=A • (A⋅B)′=A′+B′
7
Logic algebra…
➢Applications of Logic Algebra:
1.Digital Circuit Design: Logic algebra is extensively used in
designing and analysing digital circuits, including combinational
and sequential circuits.
2.Computer Systems: The principles of logic algebra are
fundamental to computer architecture, where they govern the
operations of logic gates, arithmetic units, and memory units.
3.Boolean Functions: Logic algebra is employed to represent and
manipulate Boolean functions, which are essential in software
design, control systems, and decision-making processes.
8
Logic algebra…
4. Coding and Error Detection: Error detection and correction
codes, such as parity bits, rely on logic algebra to ensure data
integrity in communication systems.
5. Automated Systems: Logic algebra is applied in designing
automated systems, including robotics and industrial control
systems, to model and control system behaviour.
➢ Logic algebra provides a systematic and mathematical
foundation for understanding and manipulating binary variables
and logical operations, forming a cornerstone in the fields of
digital design, computer science, and automation.
9
1.2Logic circuits
➢ Logic circuits are electronic circuits that perform logical operations based on
Boolean algebra.
➢ These circuits use digital signals (binary, consisting of 0s and 1s) to process and
manipulate information.
➢ Logic circuits are the building blocks of digital systems, such as computers,
microcontrollers, and other electronic devices, enabling them to perform complex
tasks through the combination of simple logic gates.
➢ Key Components of Logic Circuits:
1. Logic Gates: Logic gates are the fundamental building blocks of logic circuits.
They perform basic logical operations (AND, OR, NOT) on binary inputs to produce
a binary output.
10
Logic circuits…
➢ Common types of logic gates include:
• AND Gate:
• Output is 1 only if both inputs are 1.
• Symbol: A⋅B or AB
• OR Gate:
• Output is 1 if at least one input is 1.
• Symbol: A+B or A∪B
• NOT Gate:
• Output is the inverse of the input.
• Symbol: ‾A or ′A′
• Other gates, such as NAND, NOR, and XOR, are derived from combinations of these
basic gates.
11
Logic circuits…
2. Flip-Flops: Flip-flops are memory elements that store binary information.
➢ They are crucial for sequential logic circuits, allowing the storage of data
and the creation of memory elements in electronic systems.
3. Registers: Registers are collections of flip-flops used for temporary data
storage.
➢ They are vital for tasks like data transfer, arithmetic operations, and
control in digital systems.
4. Multiplexers and Demultiplexers: Multiplexers select one of several input
data lines and direct it to a single output line.
➢ Demultiplexers perform the reverse operation, directing one input to
several output lines.
12
Logic circuits…
5. Arithmetic Logic Units (ALUs): ALUs perform arithmetic and logic
operations on binary numbers.
➢ They are integral components of processors and microcontrollers,
handling tasks like addition, subtraction, AND, OR, and other
operations.
6. Decoder and Encoder: Decoders convert binary information from
one code to another, while encoders perform the opposite task.
➢ They are essential for tasks such as data compression and
decompression.
13
Logic circuits…
Types of Logic Circuits:
1. Combinational Logic Circuits: These circuits produce an output
based solely on the current input values.
➢ The output is determined by the combination of logic gates and
does not depend on the circuit's previous state.
2. Sequential Logic Circuits: Sequential logic circuits include
memory elements, such as flip-flops, and the output depends on
both the current input values and the circuit's previous state.
These circuits have a notion of time and memory.
14
Logic circuits…
3. Digital Signal Processors (DSPs): DSPs are specialized
processors designed for digital signal processing tasks, such as
audio and image processing.
➢They often incorporate specialized logic circuits for efficient
computation.
4. Microprocessors and Microcontrollers: These are central
processing units (CPUs) that form the core of computers and
embedded systems.
➢ They include extensive logic circuitry to execute instructions,
manage memory, and control peripherals.
15
Logic circuits…
Applications of Logic Circuits:
1. Computer Processors: Logic circuits are the foundation of central
processing units (CPUs) in computers, executing instructions and
performing arithmetic and logic operations.
2. Memory Systems: Flip-flops and registers in logic circuits form the
basis of memory systems in computers and other digital devices.
3. Control Systems: Logic circuits are used in control systems to manage
and coordinate the operation of various components in industrial,
automotive, and robotic applications.
4. Communication Systems: Logic circuits are employed in
communication systems for tasks such as signal modulation,
demodulation, and error detection and correction.
16
Logic circuits…
5. Consumer Electronics: Devices like smartphones, TVs, and digital cameras
utilize logic circuits for processing and controlling various functions.
6. Automotive Electronics: Logic circuits play a crucial role in automotive
control systems, managing functions like engine control, airbag deployment,
and entertainment systems.
7. Embedded Systems: In embedded systems, logic circuits control and
coordinate various functions, making them integral to devices such as IoT
devices, medical instruments, and industrial controllers.
➢ Logic circuits are essential components in the world of digital electronics,
enabling the creation of sophisticated and intelligent systems by combining
simple logical operations.
➢They form the backbone of digital technology, contributing to the
functionality and efficiency of a wide range of electronic devices.
17
1.3 Logic devices such as counters,
timers and finite state machines
➢They are crucial components in digital systems and electronic circuits.
➢ They serve specific functions and play essential roles in controlling and sequencing
operations.
➢ Let's explore each of these logic devices:
1. Counters: Counters are sequential logic circuits that count in a prescribed sequence. They
can count up, down, or in a more complex pattern based on the application requirements.
➢ Types of Counters:
• Binary Counters: Count in binary sequence (000, 001, 010, ...).
• Decade Counters: Count in decimal sequence (0, 1, 2, ..., 9).
• Up Counters: Count upwards.
• Down Counters: Count downwards.
18
Logic devices …
• Synchronous Counters: The state of each flip-flop is updated
simultaneously.
• Asynchronous Counters: The state of each flip-flop is updated
sequentially.
➢Applications of Counters:
• Digital Clocks: Counters are used to keep track of time in digital
clocks.
• Frequency Dividers: Dividing the frequency of a signal.
• Event Counters: Counting occurrences of events in industrial
automation.
19
Logic devices …
• Digital Clocks: Counters are used to keep track of time in digital clocks.
• Frequency Dividers: Dividing the frequency of a signal.
• Event Counters: Counting occurrences of events in industrial automation.
2. Timers: Timers are devices that measure the duration of time intervals. They can
be used for precise time control and scheduling of events.
➢Types of Timers:
• Monostable Multivibrators: Output stays high for a fixed duration after
triggering.
• Astable Multivibrators: Produce a continuous square wave output.
• Digital Timers: Implemented using digital logic circuits for more accurate
timing.
20
Logic devices …
➢ Applications of timers:
• Industrial Automation: Timers control processes and events in
manufacturing.
• Microcontroller-based Systems: Timers are often integrated into
microcontrollers for various timing functions.
• Automotive Systems: Used in vehicle control systems for
functions like fuel injection timing.
21
Logic devices …
3. Finite State Machines (FSMs): Finite State Machines model the behaviour of
systems that can exist in a finite number of states. They transition between states
based on inputs and current states.
➢ Types of FSMs:
• Moore Machines: The output depends only on the current state.
• Mealy Machines: The output depends on both the current state and inputs.
➢ Applications:
• Digital Circuit Design: FSMs are used to design control units for processors.
• Communication Protocols: FSMs model the behaviour of communication
protocols.
• Traffic Light Controllers: FSMs control the sequence of traffic lights in an
intersection. 22
Logic devices …
➢Key Components of FSMs:
• States: Represent different modes or conditions.
• Transitions: Define conditions triggering state changes.
• Inputs: External signals influencing state transitions.
• Outputs: Actions or signals produced by the FSM in different states.
➢ Common Characteristics of These Devices:
• Sequential Logic: They rely on sequential logic circuits, typically flip-flops, to store
and update information.
• Digital Control: All these devices are designed to operate in a digital environment
using binary signals (0s and 1s).
• Timing and Sequencing: They involve precise timing and sequencing of events,
making them crucial in digital systems.
23
Logic devices …
➢ Counters, timers, and finite state machines are integral
components in digital systems, providing essential control and
sequencing functions.
24
25