Digital Logic
BE
Er. Anuj Sherchan
Assistant Professor
Introduction
• What is a Signal?
• Signal is an electromagnetic wave that carries information through a physical
medium.
• Here the data is converted into an electromagnetic signal either analog or digital
and sent from sender to receiver.
• Voltage and current are a few time-varying quantities that are used to represent
data, by varying these quantities with respect to time data can be transmitted.
• Similarly, signal is also represented as the function of the frequency domain rather
than the time domain.
• For communicating between two systems, a message signal is passed through an
encoder and modulator to transmit through a medium while it is passed through a
decoder and demodulator to receive the message signal at the other end.
Introduction
• Signals are divided into two categories based on their nature.
• Signal that are Continuous as time-varying in nature are
analog signals.
• Signals which are discrete are called digital signals.
• Analog Signals
• Analog signal is a form of electrical energy (voltage, current, or electromagnetic
power) for which there is a linear relationship between electrical quantity and the value
that the signal represents.
• The signal whose amplitude takes any value in a continuous range is called an analog
signal.
Introduction
Introduction
• Digital Signals
• The signal, whose amplitude takes only limited values is called a Digital signal.
• Digital signals are discrete, they contain only distinct values.
• Digital signals carry binary data i.e. 0 or 1 in the form of bits, it can only contain one
value at a period of time.
• Digital signals are represented as square waves or clock signals.
• Examples of Digital Signals
• Smart transmitters using various protocols transmit data through analog and digital
signals.
• Digital watches.
• Digital video signals.
• CD’s.
• DVD’s.
• Computer.
Difference between Analog and Digital
Signals
Analog Signals Digital Signals
Analog signal is continuous and time varying. Digital signal have two or more states and in binary form.
Troubleshooting of analog signals are difficult. Troubleshooting of digital signals are easy.
An analog signal is usually in the form of sine wave. An digital signal is usually in the form of square wave.
Easily affected by the noise. These are stable and less prone to noise.
Analog signals use continous values to represent the data. Digital signals use discrete values to represent the data.
Accuracy of the analog signals may be affected by noise. Accuracy of the digital signals are immune from the noise.
Analog signals may be affected during data transmission. Digital signals are not affacted during data transmission.
Analog signals use more power. Digital signals use less power.
Examples: Temperature, Pressure, Flow measurements, etc. Examples: Valve Feedback, Motor Start, Trip, etc.
Components like resistors, Capacitors, Inductors, Diodes are used in analog circuits. Components like transistors, logic gates, and micro-controllers are used in Digital circuits.
Digital Computer and Digital System
• Digital Computers
• A Digital computer can be considered as a digital system that performs various
computational tasks.
• The first electronic digital computer was developed in the late 1940s and was used
primarily for numerical computations.
• By convention, the digital computers use the binary number system, which has
two digits: 0 and 1.
• A binary digit is called a bit.
• A computer system is subdivided into two functional entities: Hardware and
Software.
Digital Computer and Digital System
• The hardware consists of all the electronic components and electromechanical
devices that comprise the physical entity of the device.
• The software of the computer consists of the instructions and data that the
computer manipulates to perform various data-processing tasks.
Digital Computer and Digital System
• The Central Processing Unit (CPU) contains an arithmetic and logic unit for
manipulating data, a number of registers for storing data, and a control circuit for
fetching and executing instructions.
• The memory unit of a digital computer contains storage for instructions and data.
• The Random Access Memory (RAM) for real-time processing of the data.
• The Input-Output devices for generating inputs from the user and displaying the
final results to the user.
• The Input-Output devices connected to the computer include the keyboard, mouse,
terminals, magnetic disk drives, and other communication devices.
Digital Computer and Digital System
• Advantages of digital system:
• Have made possible many scientific, industrial, and commercial advances that
would have been unattainable otherwise.
• Less expensive
• More reliable
• Easy to manipulate
• Flexibility and Compatibility
• Information storage can be easier in digital computer systems than in analog ones.
New features can often be added to a digital system more easily too.
Digital Computer and Digital System
• Disadvantages of digital system:
• Use more energy than analog circuits to accomplish the same tasks, thus
producing more heat as well.
• Digital circuits are often fragile, in that if a single piece of digital data is lost or
misinterpreted,
the meaning of large blocks of related data can completely change.
• Digital computer manipulates discrete elements of information by means of a
binary code.
• Quantization error during analog signal sampling.
Information Representation
• Signals
• Information variables represented by physical quantities.
• For digital systems, the variables take on discrete values.
• Two level or binary values are the most prevalent values in digital systems.
• Binary values are represented abstractly by:
• digits 0 and 1
• words (symbols) False (F) and True (T)
• words (symbols) Low (L) and High (H)
• and words On and Off.
• Binary values are represented by values or ranges of values of physical quantities
Information Representation
• Signal Examples over time
Information Representation
• Here is an example waveform of a quantized signal. Notice how the magnitude of
the wave can only take certain values, and that creates a step-like appearance.
• This image is discrete in magnitude, but is continuous in time (asynchronous).
Information Representation
Data Types
Fig: Data Representation
Data Types
• Representing Numbers
• Numeric data consists of numbers that can be used in arithmetic operations.
• Digital devices represent numeric data using the binary number system, also called
base 2.
• Number System
• Decimal System
• Base, or radix (r) = 10
• 10 symbols: 0,1,2,3,4,5,6,7,8,9
• E.g. 630.5 = 6*10^2 + 3*10^1 + 0*10^0 + 5*10^-1
Data Types
Data Types
Data Types
Data Types
Data Types
• Binary System
•r=2
• 2 symbols: 0,1
• E.g. 110010.01 = 1*2^5 + 1*2^4 + 0*2^3 + 0*2^2 + 1*2^1 + 0*2^0 + 0*2^-1 +
1*2^-2
• The binary number system only has two digits: 0 and 1.
• No numeral like 2 exists in the system, so the number “two” is represented in
binary as 10 (pronounced “one zero”).
Data Types
Data Types
• Octal System
•r=8
• 8 symbols: 0,1,2,3,4,5,6,7
• E.g. (736.4)8 =
7*8^2 + 3*8^1 + 6*8^0 + 4*8^-1
Data Types
• Hexadecimal System
• r = 16
• 16 symbols: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
• E.g. A9D = A*16^2 + 9*16^1 + D*16^0
• The hexadecimal numeral system, often shortened to "hex", is a numeral system
made up of 16 symbols (base 16).
• The standard numeral system is called decimal (base 10) and uses ten symbols:
0,1,2,3,4,5,6,7,8,9.
• Hexadecimal uses decimal numbers and six extra symbols.
Data Types
• Conversion
I. Base r to decimal
• Multiply each coefficient with the corresponding power of r and add.
II. Decimal to base r
• Divide by base r and collect the remainder upwards.
• Converting decimal fractions to binary, multiplication is used instead of division.
• And, integers are calculated instead of remainders.
• Those remainders are collected downwards.
Data Types
Data Types
III. Binary to octal (hexadecimal) & vice versa
• Conversion from binary to octal (hexadecimal) is accomplished by partitioning
the binary number into a group of 3 (for octal) or 4 (for hexadecimal) digits each
starting from binary point (.) & proceeding to the left and to the right.
• E.g. (1 101 001 . 111)2 = (151.7)8 (0110 1001 . 1101 0)2 = (69.D)16
• Converting from octal (hexadecimal) to binary is done by a process in
reverse above.
(673.124)8 = (110 111 011 . 001 010 100)2
E.g.
(306.D)16 = (0011 0000 0110 . 1101)2
Data Types
Data Types
Data Types
Data Types
Data Types
Data Types
Data Types
Data Types
Data Types
Data Types
Data Types
Data Types
Data Types
Data Types
Data Types
Data Types
Data Types
Data Types
Exercise
• Convert these binary system numbers to decimal system numbers
• a) 100101101 b) 11100.1001
• Convert 372.348 to hexadecimal system number
• Convert these numbers to octal system number
• 11100.10012
• 5A.B16
• Convert these numbers to binary system number
• 5A.B16
• 75.28
Complements
Complements
Complements
Complements
Complements
Complements
Complements
Complements
Complements
THANK YOU