0% found this document useful (0 votes)
75 views100 pages

Chapter 1

The document describes a digital logic design course that includes the following: - Course objectives are to familiarize students with basic digital logic concepts for designing digital circuits. - The textbook is Digital Design by M. M. Mano and there are two reference books listed. - Grading is based on quizzes, assignments, a midterm, and a final exam. - Course contents cover chapters 1-6 of the textbook including topics like binary systems, digital systems, and number representation in different bases.

Uploaded by

Hassnain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views100 pages

Chapter 1

The document describes a digital logic design course that includes the following: - Course objectives are to familiarize students with basic digital logic concepts for designing digital circuits. - The textbook is Digital Design by M. M. Mano and there are two reference books listed. - Grading is based on quizzes, assignments, a midterm, and a final exam. - Course contents cover chapters 1-6 of the textbook including topics like binary systems, digital systems, and number representation in different bases.

Uploaded by

Hassnain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 100

Digital Logic Design (3+1)

• Course Objectives
– To familiarize the students with basic digital logic design concept used for design of digital
circuits.
• Text Book
– M. M. Mano, "Digital Design," 4th Ed.
• Reference
– M. M. Mano, “Logic and Computer Design Fundamentals” 2nd Ed., Prentice Hall Inc.,
2000.
– Norman Balabanian, Bradley carlson, “Digital Logic Design Principles” John Wiley & Sons
Inc., 2001.
• Grade
– Quizzes: 10%
– Assignment: 10%
– Mid Term: 30%
– Final Exam: 50%
• Course contents
– Chapter 1-6
Chapter 1
Binary Systems

Digital Systems
Binary Numbers
Number Base Conversion
Octal and Hexadecimal Number
Complements
Signed Binary Numbers
Binary Codes
Binary Storage and Registers
Binary Logic
Binary Systems

• Digital age
• Digital computers
– many scientific, industrial and commercial applications
– space program
• Digital systems
– telephone switching exchanges
– digital camera
– electronic calculators, PDA's
– digital TV
• Discrete information-processing systems
• Why binary?
– reliability: a transistor circuit is either on or off (two stable states)
Digital Computer

• The digital computer is one of the most well known


digital systems.
• The digital computer consists of the following
components:
– Memory unit
– Central processing unit
– Input and output units
• The digital computer can perform both arithmetic and
logical operations.
A Digital Computer

Inputs: Keyboard, mouse, modem, Outputs: CRT, LCD, modem,


speakers
microphone

- stored program
- control unit
- arithmetic computations and logical operations
Digital Systems

• Digital Systems represent systems that understand,


represent and manipulate discrete elements.
– A discrete element is any set that has a finite number of elements, for
example 10 decimal digits, 26 letters of the alphabet, etc.
• Discrete elements are represented by signals, such as
electrical signals (voltages and currents)
• The signals in most electronic digital systems use two
discrete values, termed binary.
• Digital Systems takes a set of discrete information
inputs and discrete internal information (system state)
and generates a set of discrete information outputs.
Digital Systems

Discrete Discrete
Inputs Information
Processing
System Discrete
Outputs

System State
Signals

• A collection of information variables mapped to some


physical quantity.
• For digital systems, the quantities take on discrete
values. Two level, or binary values are the most
prevalent values in digital systems.
• The binary values are represented abstractly by digits
0 and 1.
• other physical signals represented by 1 and 0?
– CPU Voltage
– Disk Magnetic Field Direction
– CD Surface Pits/Light
– Dynamic RAM Electrical Charge
Why Digital Components?

• Why do we choose to use digital components?


– The main reason for using digital components is that they can
easily be programmed, allowing a single hardware unit to be
used for many different purposes.
– Advances in circuit technology decrease the price of
technology dramatically.
– Digital integrated circuits can perform at speeds of hundreds
of millions of operations per second.
– Error-checking and correction can be used to ensure the
reliability of the machine.
Binary Digits

• A binary digit, called a bit, is Decimal Binary Code


represented by one of two values: 0 0 0000
or 1. 1 0001
– Discrete elements can be represented by 2 0010
groups of bits called binary codes. For
example the decimal digits 0 to 9 are 3 0011
represented as follows: 4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
Differing Bases

• In order to represent numbers of different bases, we


surround a number in parenthesis and then place a
subscript with the base of the number.
– A decimal number (9233)10
– A binary number (11011)2
– A base 5 number (3024)5
• Decimal number digits are 0 through 9
• Binary number digits are 0 through 1
• Base (radix) r number digits are 0 through r - 1
Commonly Occurring Bases

Name Radix Digits (0 through r-1)


Binary 2 0,1
Octal 8 0,1,2,3,4,5,6,7
Decimal 10 0,1,2,3,4,5,6,7,8,9
Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Decimal Numbers

• A decimal number such as 5723 represents a quantity


equal to:
– 5 thousands
– 7 hundreds
– 2 tens
– 3 ones
• Or, it can be written as:
– 5 X 103 + 7 X102 + 2 * 101 + 3 * 100
• The 5, 7, 2, and 3 represent coefficients.
• The decimal number system is said to be of base or
radix 10 because it uses the 10 digits (0..9) and the
coefficients are multiplied by powers of 10.
Binary Numbers

• The binary system contains only two values in the


allowed coefficients (0 and 1).
• The binary system uses powers of 2 as the
multipliers for the coefficients.
• For example, we can represent the binary number
10111.01 as:
– 1 X 24 + 0 X 23 + 1 X 22 + 1 X 21 + 1 X 20 + 0 X 2-1 + 1 X 2-2 = 23.25
Understanding Binary Numbers

• Binary numbers are made of binary digits (bits):


– 0 and 1
• How many items does an binary number represent?
– (1011)2 = 1x23 + 0x22 + 1x21 + 1x20 = (11)10
• What about fractions?
– (110.10)2 = 1x22 + 1x21 + 0x20 + 1x2-1 + 0x2-2
• Groups of eight bits are called a byte
– (11001001) 2
• Groups of four bits are called a nibble.
– (1101) 2
Understanding Binary Numbers (Contd…..)

• MSB – most significant bit MSB LSB


1011001010011100
• LSB – least significant bit 15 0
• Bit numbering

• Each digit (bit) is either 1 or 0 1 1 1 1 1 1 1 1


• Each bit represents a power of 2 27 26 25 24 23 22 21 20
Why Use Binary Numbers?

° Easy to represent 0 and 1 using


electrical values.
° Possible to tolerate noise.
° Easy to transmit data
° Easy to build binary circuits.

AND Gate

1
0
0
Powers of Two
Important powers of 2

210 is referred to as Kilo, called "K"

220 is referred to as Mega, called "M"

230 is referred to as Giga, called "G"


Octal Numbers

• The octal number system is a base-8 system that


contains the coefficient values of 0 to 7.
• The octal system uses powers of 8 as the multipliers
for the coefficients.
• For example, we can represent the octal number
72032 as:
7 X 84 + 2 X 83 + 0 X 82 + 3 X 81 + 2 X 80 = (29722)10
Hexadecimal Numbers

• The hexadecimal number system is a base-16 system


that contains the coefficient values of 0 to 9 and A to
F. The letters A through F represent the coefficient
values of 10, 11, 12, 13, 14, and 15, respectively.
• The hexadecimal system uses powers of 16 as the
multipliers for the coefficients.
• For example, we can represent the hexadecimal
number C34D as:
– 12 X 163 + 3 X 162 + 4 X 161 + 13 X 160 = (49997)10
Number Examples
Conversion between bases

• To convert from one base to other:


– Convert the integer portion
– Convert the fraction portion
– Join the two with radix point Octal (base 8)

Binary (base 2) Decimal (base 10)

Hexadecimal
(base16)
r-Decimal Conversion

• Conversion of a number in base r to decimal is done


by expanding the number in a power series and
adding all the terms.
• For example, (C34D)16 is converted to decimal:
12 X 163 + 3 X 162 + 4 X 161 + 13 X 160 = (49997)10
• (11010.11)2 is converted to decimal:
1 X 24 + 1 X 23 + 0 X 22 + 1 X 21 + 0 X 20 + 1 X 2-1 + 1 X 2-2 = 26.75

• In general (Number)r = ( i = n −1
i =0
ai • r +
i
) ( j = −1
a
j =− m j
• r j
)
(Integer Portion) + (Fraction Portion)
Decimal-r Conversion
• If a decimal number has a radix point, it is necessary
to separate the number into an integer part and a
fraction part.
• The conversion of a decimal integer into a number in
base-r is done by dividing the number and all
successive quotients by r and accumulating the
remainders in reverse order of computation.
• For example, to convert decimal 13 to binary:

Integer
Quotient Remainder Coefficient
13/2 = 6 + ½ a0 = 1
6/2 = 3 + 0 a1 = 0
3/2 = 1 + ½ a2 = 1
1/2 = 0 + ½ a3 = 1
Answer (13)10 = (a3 a2 a1 a0)2 = (1101)2
Example

• Convert (37)10 to binary

(37)10 = 100101
Decimal-r Conversion (converting fraction)

• To convert the fraction portion repeatedly multiply the


fraction by the radix and save the integer digits that
result. The process continued until the fraction
becomes 0 or the number of digits have sufficient
accuracy. The new radix fraction digits are the integer
digits in computed order.
• For example convert fraction (0.6875)10 to base 2
0.6875 * 2 = 1.3750 integer = 1
0.3750 * 2 = 0.7500 integer = 0
0.7500 * 2 = 1.5000 integer = 1
0.5000 * 2 = 1.0000 integer = 1

Answer = (0.1011)2
Example:

• Convert 0.8125 decimal to


binary.
– To convert the decimal 0.8125
to binary, we multiply by the
radix 2.
– (0.1101)2
Decimal to Octal Conversion

• In converting decimal to octal we must divide by 8.


Converting Fractions (Decimal to Octal)

• Decimal to Octal fraction conversion takes the same


approach but it multiplies by the base 8.
Converting Decimal to Hexadecimal

• The conversion of a decimal integer into hexadecimal


is done by dividing the number and all successive
quotients by 16 and accumulating the remainders in
reverse order of computation.

(422)10 = (1A6)16
Binary, Octal and Hexadecimal

• Conversions between binary, octal and hexadecimal


have an easier conversion method.
– Each octal digit represents 3 binary digits.
– Each hexadecimal digit represents 4 binary digits.
Binary to Octal and back

• Binary to Octal:
– Group the binary digits into three bit groups starting at the radix
point and going both ways, padding with zeros as needed (at the
ends).
– Convert each group of three bits to an equivalent octal digit.
• Octal to Binary:
– It is done by reversing the preceding procedure
– Restate the octal as three binary digits
– Start at the radix point and go both ways, padding with zeros as
needed.
Examples

• Convert (10110001101011.11110000011)2 to Octal


= 010 110 001 101 011 . 111 100 000 110
= 2 6 1 5 3 . 7 4 0 6
= (26153.7406)8
• Convert (673.124)8 to binary
= 110 111 011 . 001 010 100
= (110111011.001010100)2
• Convert (11010100011011) 2
to Octal
Binary to Hexadecimal and back

• Binary to Hexadecimal:
– Group the binary digits into four bit groups starting at the radix point
and going both ways, padding with zeros as needed (at the ends)
– Convert each group of four bits to an equivalent hexadecimal digit
• Hexadecimal to Binary:
– It is done by reversing the preceding procedure
– Restate the hexadecimal as four binary digits
– Start at the radix point and go both ways, padding with zeros as
needed
Examples

• Convert (10110001101011.11110010)2 to hexadecimal


= 0010 1100 0110 1011 . 1111 0010
= 2 C 6 B . F 2
= (2C6B.F2)16
• Convert (306.D)16 to binary
= 0011 0000 0110. 1101
= (001100000110.1101)2
• Convert (11010100011011) 2
to hexadecimal
Base-r Arithmetic

• Arithmetic operations with numbers in base r follow


the same rules as for decimal numbers.
• When a base other than 10 is used, one must
remember to use only the r-allowable digits.
• The following are some examples:
Arithmetic Rules

• The sum of two digits are calculated as expected but


the digits of the sum can only be from the r-allowable
coefficients.
• Any carry in a sum is passed to the next significant
digits to be summed.
• In subtraction the rules are the same but a borrow
adds r (where r is the base) to the minuend digit.
Binary Addition

Given two binary digits (X,Y), a carry in (Z) we get


the following sum (S) and carry (C):
Carry in (Z) of 0: Z 0 0 0 0
X 0 0 1 1
+Y +0 +1 +0 +1
CS 00 01 01 10

Carry in (Z) of 1: Z 1 1 1 1
X 0 0 1 1
+Y +0 +1 +0 +1
CS 01 10 10 11
Binary Addition Examples

carry: 1

0 0 0 0 0 1 0 0 (4)

+ 0 0 0 0 0 1 1 1 (7)

0 0 0 0 1 0 1 1 (11)
bit position: 7 6 5 4 3 2 1 0

1 1 1 1 1
1 carries
1
1 1 1 0 1
+ 1 0 1 1 1
---------------------
1 0 1 0 1 0 0
Binary Subtraction Example

1 10 borrows
0 10 10 0 0 10

1 00 1 1 0 1
- 1 0 1 1 1
------------------------
1 1 0 1 1 0
Binary Multiplication and Division

• Multiplication table 1
0 1 1 1
0x0=0 X 1 0 1 0
-----------------------
0x1=0 0 0 0 0 0
1x0=0 1 0 1 1 1
1x1=1 0 0 0 0 0
1 0 1 1 1
-----------------------
1 1 1 0 0 1 1 0

• Binary division is similar to decimal division


Complements

• Complements are used to simplify subtraction


operations. We do subtraction by adding.
A – B = A+ (-B)
• There are two types:
– The radix complement, called the r’s complement.
– The diminished radix complement, called the (r-1)’s complement.
Diminished Radix Complement (DRC)

• Given a number N in base r having n digits, the (r-1)’s


complement of N is defined as:
(rn – 1) – N
• Decimal numbers are in base-10.
(r-1) = (10-1) = 9.
• The 9’s complement would be defined as:
(10n – 1) – N
• So, to determine the 9’s complement of 52:
(102 – 1) – 52 = 47
• Another example is to determine the 9’s complement
of 3124:
(104 – 1) – 3124 = 6875
Finding Diminished Radix Complement (DRC)

• The DRC or (r-1)’s complement of decimal number is


obtained by subtracting each digit from 9
• The (r-1)’s complement of octal or hexadecimal
number is obtained by subtracting each digit from 7 or
F, respectively
• The DRC (1’s complement) of a binary number is
obtained by subtracting each digit from 1. It can also
be formed by changing 1’s to 0’s and 0’s to 1’s
DRC for Binary Numbers

• For binary numbers r = 2 and (r-1) = 1. So, the 1’s


complement would be defined as:
(2n – 1) – N
• To determine the 1’s complement of 1000101:
(27 – 1) – 1000101 = 0111010
• To determine the 1’s complement of 11110111101:
(211 – 1) - 11110111101 = 00001000010

• Note that 1’s complement can be done by switching


all 0’s to 1’s and 1’s to 0’s.
Radix Complement

• The r’s complement of an n-digit number N in base-r is


defined as:
rn – N - for N  0
0 - for N = 0
• We may obtain r’s complement by adding 1 to (r-1)’s
complement. Since rn – N = [(rn – 1) – N]+1
• 10’s complement of 3229 is:
104 – 3229 = 6771
• 2’s complement of 101101 is:
26 – 101101 = 010011

• Note that to determine 2’s complement, leave the least


significant 0’s and the first 1 unchanged and then
switch the remaining 1’s to 0’ and 0’s to 1’s.
2’s Complement

• Another method to find 2’s complement is


– Complement (reverse) each bit
– Add 1
• Example:

Note that 00000001 + 11111111 = 00000000


Notes on Complements

• A couple of notes on complements to keep in mind:


– If you are trying to determine the complement of a value that
contains a radix point:
» Remove the radix point.
» Determine the complement.
» Replace the radix point in the same relative position.
– The complement of a complement will restore the original number.
Subtraction with Complements

• In digital computers the use of borrows to complete


subtraction is inefficient. Complements are used to
overcome this inefficiency.
• The subtraction of two n-digit unsigned numbers M –
N in base r can be done as follows:
– Add the minuend, M, to the r’s complement of the subtrahend, N:
» M + (rn – N) = M – N + rn
– If M  N, the sum will produce an end carry, rn, which can be
discarded; what is left is the result of M – N.
– If M  N, the sum does not produce an end carry and is equal to rn
– (N – M), which is the r’s complement of (N – M). To obtain the
answer in a familiar form, take the r’s complement of the sum and
place a negative sign in front.
10’s Complement Subtraction

• Using 10’s complement, subtract 62513 – 2140

• Note that the extra 9 in the 10’s complement of N is to fill the


space holder 0.
10’ Complement Subtraction

• Using 10’s complement, subtract 2140 - 62513


2’s Complement Subtraction

• Using 2’s complement, subtract 1001001 - 1000110


2’s Complement Subtraction

• Using 2’s complement, subtract 1000110 - 1001001


Using 1’s Complement

• You can also use the 1’s complement for performing


subtraction.
• You can add the minuend M to the (r-1)’s complement
of subtrahend N. Then inspect the result
– If an end carry occurs add 1
– If there is no end carry take (r-1)’s complement of the result obtained
and place a negative sign
– Note: Remember that 1’s complement is 1 less than 2’s complement.
This means we must compensate by adding 1 when an end carry
occurs. Removing an end-carry and adding one is called an end-
around carry.
1’s Complement Subtraction

• Using 1’s complement, subtract 1001001 - 1000110


1’s Complement Subtraction

• Using 1’s complement, subtract 1000110 - 1001001


Signed Binary Numbers

• In ordinary arithmetic a negative number is indicated


by minus sign and positive number by plus sign. This
is not possible in computers, because of hardware
limitation computers must represent everything with
binary digits. There are two methods to do this:
– The signed magnitude convention uses the left-most bit to represent
the sign (0 for positive and 1 for negative).
– The signed complement system negates a number by taking its
complement.
» It could be either, 1’s complement representation
» or 2’s complement representation.
sign bit
Signed Magnitude Convention
1 1 1 1 0 1 1 0
Negative

0 0 0 0 1 0 1 0 Positive

• The signed magnitude convention uses the left-most bit


to represent the sign (0 for positive and 1 for
negative).
– The user determines whether the number is signed or unsigned
– If the binary number is signed then the leftmost bit represents the
sign and the rest of the bits represents the number
– If the binary number is unsigned then the leftmost bit is the most
significant bit of the number
– For example:
» 01001 can be considered as 9 (unsigned binary) or a +9 because
the left most bit is zero.
» On the other hand, the string of bits 11001 represents binary
equivalent of 25 when considered as an unsigned number or as
–9 when considered as signed number
Signed Complement System

• The signed Complement System negative number is


indicated by its complement (Complement of positive
number)
– Positive numbers always start with 0 (plus), its complement
(representing negative number) will always start with 1
– Signed complement system can use either 1’s complement or 2’s
complement.
– For example:
» +9 is represented only as 00001001 but –9 can be represented
as:
• 11110110 Signed 1’s complement representation
• 11110111 Signed 2’s complement representation
Number Representations

• The following is the representation for +11:


– 00001011
• The following are different methods for representing
-11:
– Signed magnitude: 10001011
– Signed-1’s-complement: 11110100
– Signed-2’s-complement: 11110101
Arithmetic Addition (Signed-Magnitude System)

• The addition of two signed binary numbers in the


signed-magnitude system follows the rules of
ordinary arithmetic
• If the signs are the same we add the two magnitudes
and give the sum the common sign
• If the signs are different we subtract the smaller
magnitude from the larger and give the result the sign
of the larger magnitude
Arithmetic Addition (Signed 2’s Complement system)

• This system doesn’t require the comparison of the


signs and the magnitudes (as in signed-magnitude
system), but only addition.
• The addition of two signed binary numbers with
negative numbers represented in signed-2’s
complement form is obtained from addition of the two
numbers, including their sign bits.
• A carry out of the sign-bit position is discarded.
• If the sum is negative, it will be in 2’s complement
form.
Arithmetic Subtraction

• Subtraction can be performed by simply converting


the equation into an addition formula.
– Take the 2’s complement of the subtrahend (including the sign bit)
and add it to the minuend (including the sign bit)
– A carry out of the sign bit position is discarded
– Note: Subtraction operation can be changed to an addition operation
if the sign of the subtrahend is changed. This is easily done by
taking it’s 2’s complement
Example Arithmetic (Signed 2’s Complement)
Example

• Consider the subtraction (–6) –(–13) = +7


• In binary with eight bits the same is written as
(11111010 – 11110011)
• This subtraction is changed to addition by taking 2’s
complement of the subtrahend (– 13) to give (+ 13)
• In binary this is 11111010 + 00001101 = 100000111
• Removing the end carry, we obtain the correct
answer: 00000111(+7)
Binary Codes

• All symbols in a computer must be represented by a


binary code (binary representation).
• An n-bit binary code is a group of n bits that can
represent up to 2n distinct combinations of 1’s and
0’s.
– Each distinct combination represents a single symbol in the
computer.
BCD Code (8 4 2 1)

• The most common representation


for binary digits is the binary coded
decimal (BCD) form which is a binary
assignment of the decimal numbers.
– This code is the simplest, most intuitive
binary code for decimal digits and uses
the same weights as a binary number,
but only encodes the first ten values
from 0 to 9 (6 out of 16 possible
combinations remains unassigned ).
– A number with k distinct decimal digits
will require 4k bits in BCD.
– Each digit of a decimal value is
converted to its respective binary
representation.
– BCD number needs more bits than its
equivalent binary value?
Multi-Digit BCD
BCD Addition

• BCD only represents each of the decimal digitals 0


through 9 as a single 4-bit binary value.
• When adding two BCD values, if the sum is equal to or
less than 1001 (9), the corresponding BCD value is
correct.
• However, when the binary sum is greater or equal to
1010 (10), the result is an invalid BCD value.
– To overcome the invalid BCD value add 0110 (6) to the result to obtain
the BCD representation and also produces a carry as required.
» The use of 0110 (6) works because the difference between a carry
in the most significant bit position of the binary sum and a
decimal carry differ by 16-10 = 6.
BCD Addition Examples
Multi-Digit BCD Addition
Other Decimal Codes

• There are various other decimal codes that can be


used:
– BCD (8 4 2 1)
– 2421
– Excess-3 code. (adds binary 0011 to the BCD code)
– 8 4 -2 -1
– Gray Code
– ASCII Character Code
– Error-Detecting Code
• Each bit has a "weight" associated with it and you can
compute the decimal value by adding the weights
where a 1 exists in the code-word.
Four Different Binary Codes
Gray Code

• It is sometimes convenient to use the Gray code to


represent the digital data when it is converted from
analog data
• The advantage of Gray code over straight binary
number sequence is that only one bit in the code
group changes when going from one number to the
next
Gray Code
Gray Code Vs Binary Code

• Compare the
number of bits
changing when
going from one
number to the
next:
– In Gray code it is
always 1 bit.
ASCII Character Code

• The American Standard Code for Information


Interchange (ASCII) uses seven bits to code 128
characters, representing the alphabet, decimal
numbers, and various other symbols.
– The following ASCII chart allows you to specify the characters in
decimal representation by concatenating the column headings to the
row headings.
» For example, the character 5 is represented in binary as 0110101
ASCII Table
ASCII Table (Contd ……)
Error-Detecting Code

• Error-Detecting uses an eighth bit (added to 7-bit ASCII


character) to indicate parity.
– A parity bit is an extra bit that is set to 0 or 1 as needed to make the
total number of 1’s either even or odd.
– In an odd-parity code, the parity bit is specified so that the total
number of ones is odd.
– In an even-parity code, the parity bit is specified so that the total
number of ones is even.
– It detects one, three or any odd combination of errors but even
combination of errors is undetected.

P Information Bits
1 1 0 0 0 0 1 1 0 1 0 0 0 0 1 1
 
Added even parity bit Added odd parity bit
Parity Code Example

• Concatenate a parity bit to the ASCII code for the


characters 0, X, and = to produce both odd-parity and
even-parity codes.

Character ASCII Odd-Parity Even-Parity


ASCII ASCII

0 0110000 10110000 00110000

X 1011000 01011000 11011000

= 0111100 10111100 00111100


Binary Storage

• Binary storage represents the storage mechanisms for


binary data stored in a computer.
– A binary cell is a device that possesses two stable states and it can
store a single state value (0 or 1). It stores single bit of data.
examples: flip-flop circuits, ferrite cores, capacitor
– A register is a group of binary cells. n cells allows the register to
store n bits and thus 2n possible states.
» The type of information (BCD, ASCII, etc.) stored in a register
has to be agreed upon by the users of the register.

0 0 1 0 1 0 1 1

Binary Cell
Register Transfer

• A register transfer operation involves the transfer of


binary information from one set of binary registers
into other set of binary registers.
• The capture and storage of information requires:
– An input register to store the key inputs from the keyboard
– A processor register to store the data when processed by the CPU
– A memory register in the memory unit to store the values
Register Transfer

• Data input at keyboard


• Shifted into place
• Stored in memory

– NOTE: Data input in ASCII


Binary Information Processing

• The actual processing of binary information in a


computer is completed by digital logic circuits which
have been implemented to serve a specific purpose
(i.e. addition).
– The registers are accessed (read and write) when they are needed to
complete an operation. For example we need two register sets to
store two values to be added and a register set to store the result of
the sum.
» Furthermore, we need three registers in both the memory unit
and in the processor.
Example Binary Information Processing

• We need processing
• We need storage
• We need communication
Binary Logic

• Binary logic consists of binary variables and logical


operations.
– The variables are designated by letters of the alphabet (A, B, C, x, y,
z, etc.).
– There are three basic logical operations:
» AND
» OR
» NOT
Logical Operations

• AND is represented by a dot or the absence of an operator.


– x·y = z or xy = z
– Read as “x and y is equal to z”
– Means that z=1 if and only if x=1 and y=1
• OR is represented by a plus sign.
– x+y = z
– Read as “x or y is equal to z”
– Means that z=1 if x=1 or y=1 or both x=1 and y=1
• NOT is represented by a prime or an overbar.
– x’=z or x = z
– Read as not x is equal to z
– Means that if x=1 then z=0 or if x=0 then z=1
Truth Tables

• Since each binary variable consists of value of 0 or 1,


each combination of values for the variables involved
in a binary operation has a specific result value.
• A truth table is a method of visualizing all possible
combinations of the input values and the respective
output values that occur due to the operation on the
specified combination.
AND Truth Table

AND
A B A.B
0 0 0
0 1 0
1 0 0
1 1 1
OR Truth Table

OR
A B A+B
0 0 0
0 1 1
1 0 1
1 1 1
NOT Truth Table

NOT
A A'
0 1
1 0
Binary Signal

• Two separated voltage


levels represents a
binary variable equal to
logic 1 or logic 0
• Logic 0 is equal to 0 volt
and logic 1 equal to 4 volt
(with acceptable range as
shown in figure)
Logic Gates

• Logic gates are electronic circuits that operate on one or


more input signals to produce an output signal.
– The state (high-low, on-off) of electricity on a line represents each of the two
states for binary representation (1 or 0).

• Logic Gate Notation


AND Logic Function

• Using door • Using Switches


– Both doors are opened to • Switches are input and LED
pass the light is output
• Both switches closed (ON)
to give output
OR Logic Function

• Using door • Using Switches


– Any one or both doors are • Switches are input and LED
opened to pass the light is output
• Any one switch or both
closed to give output
Timing Diagram
Multi-Input Circuits
End of Chapter 1
End of Chapter 1

You might also like