You are on page 1of 105

Prepared by

Dr. Mounib Khanafer

Slides are based on


Manos textbook
Digital systems have a prominent role in everyday life
Thats why we refer to the present technological period
as the digital age
Digital systems are used in every commercial,
industrial, and scientific enterprise:
Communication
Business transactions
Traffic control
Spacecraft guidance
Weather monitoring
Medical treatment
Internet
We have digital telephones, digital TVs, digital
cameras, handheld devicesetc
These systems have a digital computer embedded
within them
This digital computer can follow a sequence of
instructions (i.e., a program), that operates on a given
data
We can change the programs or the input data to serve
our various needs
This flexibility in controlling these systems allows us to
support a broad range of applications
Digital systems are able to represent and manipulate discrete
elements of information
Any set that is restricted to a finite number of elements
contains discrete information:
The 10 decimal digits
The 26 letters of alphabet
The 52 playing cards
Early digital computers were used for numeric computations
In this case, the discrete elements were the digits
From this application, the term digital computer emerged
Discrete elements of information are represented in a digital
system by physical quantities called signals
The most common signals are the electrical signals. Like the voltages
and currents
The signals in most present-day digital systems use just two
discrete values and therefore said to be binary
A binary digit, called a bit, has two values: 0 and 1
Discrete elements of information are represented with groups of
bits called binary codes
For example: the number 7 is represented in a digital system with the
code 0111
Thus, we are able to use a pattern of bits to represent a certain discrete
element of information
In conclusion, a digital system is a system that manipulates
discrete elements of information represented internally in binary
forms
A decimal number such as 7392 represents a quantity
equal to 7 thousands, plus 3 hundreds, plus 9 tens, plus
2 units Coefficients

Note that 7392 can be written as follows:


7 103 + 3 102 + 9 101 + 2 100
The thousands, hundreds, tens, and units are powers of
10 implied by the position of the coefficients in the
number
That is, the 7392 is a shorthand notation for the
operation above
In general, a number with a decimal point is represented by a
series of coefficients:
5 4 321 0 . 1 23
is any of the 10 digits (0, 1, 2, , 9), and gives the power
of 10 by which the coefficient must be multiplied
Thus, for the number 7392 we can write:
105 5 + 104 4 + 103 3 + 102 2 + 101 1 + 100 0 + 101 1 + 102 2 + 103 3
with 3 = 7, 2 = 3, 1 = 9, 0 = 2, and the remaining
coefficients are zeroes
The decimal number system is said to be of base or
radix 10 because it uses 10 digits (that is, 0, 1, 2,, 9)
and the coefficients are multiplied by powers of 10
Another number system is the binary system in which
the coefficients have only two possible values: 0 and 1
For any number system of any base (or radix), each
coefficient is multiplied by a power of the base (e.g.,
2 ), and the results are added to obtain the decimal
equivalent of the number
For example, if we have the binary number 11010.11,
then we can get the decimal equivalent of this number
as follows:
1 24 + 1 23 + 0 22 + 1 21 + 0 20 + 1 21
+ 1 22 = 26.75
There are many different number systems
In general, a number expressed in a base-r system has
coefficients multiplied by powers of r:
. + 1 . 1 + + 2 . 2 + 1 . 1 + 0
+ 1 . 1 + 2 . 2 + + .
The coefficients range in value from 0 to 1.
For example, in decimal system, the coefficients (digits) range
from 0 to 9 while in binary system they range from 0 to 1
To distinguish between numbers of different bases, we
enclose the coefficients in parentheses and write a
subscript equal to the base used:

(4021.2)5 = 4 53 + 0 52 + 2 51 + 1 50 + 2 51 = (511.4)10

Note that for base 5, the coefficients can be only 0, 1, 2,


3, and 4
The octal number system is a base-8 system (0, 1,, 7)
An example of an octal number is 127.4
To determine its equivalent decimal value, we proceed
as follows:
The hexadecimal number system is a base-16 system
Here, we count 0, 1, 2,, 9, A, B, C, D, E, F
The letters A, B, C, D, E, F are used for the digits 10,
11, 12, 13, 14, and 15
An example of a hexadecimal number is B65F
To determine its equivalent decimal value, we proceed
as follows:
(65)16 = 11 163 + 6 162 + 5 161 + 15 160 = (46687)10
As noted before, the digits in a binary number are
called bits
When a bit is equal to 0, it does not contribute to the
sum during the conversion
Thus, as we convert from binary to decimal, we can
just add the numbers with powers of two corresponding
to the bits that are equal to 1:
(110101)2 = 32 + 16 + 4 + 1 = (53)10
Lets examine the table below which lists few numbers
obtained from 2 raised to the power of (where
ranges from 0 to 23)
In computer work, 210 is referred to as kilo (K), 220 as
mega (M), 230 as giga (G), and 240 as tera (T)
Computer capacity is usually given in bytes
A byte is equal to 8 bits and can accommodate (i.e.,
represent the code of) one keyboard character
A computer hard disk with four gigabytes of storage
has a capacity of 4 = 232 bytes (approximately 4
billion bytes)
We now present a general procedure for the conversion
of decimal numbers to a number in base
If the number includes a radix point, it is necessary to
separate the number into an integer part and a fraction
part, since each part must be converted differently
The conversion of a decimal integer to a number in
base is done by dividing the number and all
successive quotients by and accumulating the
remainders.
Lets convert decimal 41 to binary

Thus, (41)10= (101001)2


Convert decimal 153 to octal

Thus, (153)10 = (231)8


Convert (0.6875)10 to binary

Thus, (0.6875)10= (0. 1234)2= (0.1011)2


Note that we stop once we hit a fraction of zero or when the
number of digits is of sufficient accuracy, as we show in the
next example
Convert (0.513)10 to octal

Thus, (0.513)10= (0.406517)8


Note that in this example we stopped at seven significant
figures
The conversion of decimal numbers with both integer
and fraction parts is done by converting the integer and
the fraction separately and then combining the two
answers
Therefore, from Examples 1.1 and 1.3, we can write:

Also, from Examples 1.2 and 1.4, we can write:


The conversion from and to binary, octal, and
hexadecimal plays an important role in digital computers,
because shorter patterns of hex characters are easier to
recognize than long patterns of 1s and 0s
Note that B56F is used to represent 1011010101101111
Since 23 = 8, this means that we only need 3 bits to
represent the eight digits of the octal number system
That is, each octal digit corresponds to three binary digits
24 =16 , this means that we only need 4 bits to represent
the sixteen digits of the hexadecimal number system
That is, each hexadecimal digit corresponds to four binary digits
Check the table in the next slide
The conversion from binary to octal is easily
accomplished by partitioning the binary number into
groups of three digits each, starting from the binary
point and proceeding to the left and to the right
The corresponding octal digit is then assigned to each
group
For example, consider the number

(10110001101011.111100000110)2

We can re-write this number as follows:

(10 110 001 101 011 . 111 100 000 110)2

2 6 1 5 3 7 4 0 6
Thus, the equivalent octal number is (26153.7406)8
Conversion from binary to hexadecimal is similar,
except that the binary number is divided into groups of
four digits
Thus, for the binary number:
(10110001101011.11110010)2
We re-write:
(10 1100 0110 1011 . 1111 0010)2
2 C 6 B F 2
Thus, the equivalent hexadecimal number is (2C6B.F2)16
Converting from octal or hexadecimal to binary is done
by reversing the preceding procedure
Each octal digit is converted to its three-digit binary
equivalent
For example:

6 7 3 1 2 4
Similarly, each hexadecimal digit is converted to its
four-digit binary equivalent
For example:

3 0 6 D
Binary numbers are difficult to work with because they
require three or four times as many digits as their
decimal equivalents (binary 111111111111 is equivalent
to decimal 4095!)
However, digital computers use binary numbers, and it
is sometimes necessary for the human operator or user
to communicate directly with the machine by means of
such numbers
Therefore, humans can think in terms of octal or
hexadecimal numbers and then convert to binary, using
the methods of conversion discussed above, whenever
direct communication with the machine is needed
Therefore, as we discuss binary numbers in computers,
using octal or hexadecimal numbers simplify
communications between people as we need to use a
reduced number of digits
Thats why most computer manuals use either octal or
hexadecimal numbers to specify binary quantities
Usually, the use of hexadecimal numbers is preferred as
it can represent a byte with only two digits
Decimal numbers

Binary numbers

Most significant digit Least significant digit


Octal numbers

Hexadecimal numbers
Complements are used in digital computers to simplify
the subtraction operation
Simplifying operations leads to simpler, less expensive
circuits to implement the operations
We have two types of complements for each base-r
system:
The radix complement
Also called the complement
The diminished radix complement
Also called the ( 1) complement
Given a number in base having digits, the (
1) complement of is defined as 1
For decimal numbers, = 10 and 1 = 9, so the 9s
complement of a decimal number is 10 1
Thus, if we represent decimal numbers in 6 digits, then
= 6, and thus we have:
10 1 = 106 1 = 999999
This means that the 9s complement of a decimal
number is obtained by subtracting each digit of the
decimal number from 9
For example, the 9s complement of the decimal
numbers 546700 and 12398:
999999 546700 = 453299
999999 012398 = 987601
The same concept applies when dealing with binary
numbers (i.e., = 2)
Assume that = 4, then we have:
24 1 = 10000 2 1 = 1111
This means that the 1s complement of a binary number
is obtained by subtracting each digit of the binary
number from 1
However, notice that with binary numbers, as we
subtract from 1 we can have either 1 0 = 1 or 1
1 = 0, which causes the bit to change from 0 to 1 or
from 1 to 0, respectively
Therefore, the 1s complement of a binary number is
formed by changing 10 to 0s and 0s to 1s:
1 1011000 0100111
1 0101101 1010010
The 1 complement of octal and hexadecimal
numbers is obtained by subtracting each digit from 7 or
F (decimal 15), respectively
Given a number in base having digits, the
complement of is defined as for 0, and
as 0 for = 0

Note that the 1 is defined as 1 , and
therefore, if we add 1 to it we get:
[ 1 ] + 1 =
which is the complement
That is, the complement of a number can be
computed by just adding 1 to the 1
complement of
For example, the 9s complement of the 4-digit decimal
number 2389 is 9999 2389 = 7610, and directly the
10s complement will be 7611
Also, the 1s complement of binary 101100 is 010011,
and directly the 2s complement is 010011 + 1 =
010100
Note that for decimal numbers, the 10s complement of
a number is 10
10 is always represented as 1 followed by 0s
We always need to subtract from 10 to get the 10s
complement
Thus, another easy way of getting the 10s complement
of decimal numbers is by leaving all least significant
0s unchanged, subtracting the first nonzero least
significant digit from 10, and subtracting all higher
significant digits from 9
For example:
10 012398 987602
10 246700 753300
The same concept applies with binary numbers:
2 1101100 0010100
2 0110111 1001001
If the number to be complemented contains a radix
point, we temporarily remove the radix point, we
complement the number, and finally restore the radix
point to its position
Note that the complement of the complement restores
the number to its original value:
The subtraction of two n-digit unsigned numbers in
base can be done as follows:
1. Add to the complement of
Mathematically, + = +
2. If , the sum will produce an end carry , which
can be discarded; what is left is the result
3. If < , the sum does not produce an end carry and is
equal to ( ), which is the complement of
. Thus, take the complement of the sum and
place a negative sign in front:
+ =
Using 10 complement, subtract 72532 3250

Note that because has 4 digits, we should write as


03250 to have both and with same number of
digits
Note also, getting an end carry signifies that
and that the result of subtraction will be positive
Using 10s complement, subtract 3250 72532

Since we have no end carry, we just compute the 10s


complement of the result and place a negative sign:
10 30718 = 69282
Assume = 1010100 and = 1000011 and
compute X Y using the 2s complement
Now compute using the 2s complement:

There is no end carry. Therefore, the final answer is:


2 1101111 = 0010001
Its clear that using the complement simplifies the
subtraction as we dont need to use the borrow concept
anymore!
This will highly simplify the design of circuits to
implement the subtraction operation
Subtraction of unsigned numbers can be also done by
means of the ( 1) complement
Recall that the ( 1) is one less than the
complement
Because of this, + 1 produces a sum that is
one less than the correct difference when an end carry
occurs
Removing the end carry and adding 1 to the sum is referred
to as an end-around carry
Repeat Example 1.7(a) using the 1s complement:
Repeat Example 1.7(b) using the 1s complement:

Note that there is no end carry


Therefore, the final answer is:
1 1101110 = 0010001
The procedure with end-around carry also applies to
subtracting unsigned decimal numbers with 9s complement
So far we have been dealing with unsigned numbers
However, to represent negative integers we need a
notation for negative values
Computers must represent everything with binary digits
We will represent the sign with a bit placed in the
leftmost position of the number
The convention is to use the 0 bit for positive and the 1
bit for negative
Keep in mind that in a computer, both signed and
unsigned binary numbers consist of a string of bits
If the binary number is signed, then the leftmost bit
represents the sign and the rest of the bits represent the
number
If the binary numbers is unsigned, the leftmost bit is the
most significant bit of the number
For example, the string of bits 01001 can be considered
as 9 (unsigned binary) or as +9 (signed binary)
Because the leftmost bit is 0
However, the string of bits 11001 represents 25
(unsigned binary) or -9 (signed binary)
Because the leftmost bit is 1
The representation of signed numbers using the leftmost bit to
indicate the sign is referred to as the signed-magnitude
convention
This is the representation of signed numbers used in ordinary
arithmetic
Another system, however, is more convenient to use in
computers and is referred to as the signed-complement system
This system is used to implement arithmetic operations in
computers
In this system, a negative number is indicated by its complement
That is, while the signed-magnitude system negates a number by
changing its sign, the signed-complement system negates a
number by taking its complement
For the signed-complement system we can use either the 1s
or the 2s complement, but the 2s complement is the most
common
For example, consider the number 9 and lets represent it in
binary with eight bits
+9 is represented with a 0 in the leftmost position, followed by the
binary equivalent of 9, which gives 00001001
9 can be represented in three different ways:
Signed-magnitude representation: 10001001
Signed-1s-complement representation: 11110110
Signed-2s-complement representation: 11110111
Note that in getting the signed-1s and 2s complements, we
complement all the bits, including the sign bit
Note that positive numbers and zero are identical in all
columns, with a 0 in the leftmost position
This is because the signed-complement system complements
only the negative numbers
Note also, except for the signed-2s-complement
system, the zero has two representations in the other
two systems
The negative numbers are distinguished by the 1 bit in
the leftmost position
Our focus will be on the signed-2s-complement system
in the rest of Chapter 1
The rule to add numbers in signed-complement system
is stated as follows:
The addition of two signed binary numbers with negative
numbers represented in signed-2s-complement form is
obtained from the addition of the two numbers, including their
sign bits. A carry out of the sign-bit position is discarded
Consider the following examples (note that we use
eight-bit binary numbers):
Note that negative numbers must be initially in the 2s
complement form
Note also, if the sum obtained after the addition is
negative, it is in 2s complement form
For example, 7 is represented as 11111001, which is
the 2s complement of +7
In the four additions, the sign bit is included. Any carry
out of the sign-bit position is discarded, and negative
results are automatically in 2s complement form
Working with the signed-2s-complement form may be
unfamiliar to us
To determine the value of a negative number in this
form, it is necessary to convert the number to a positive
number to place it in a more familiar form
For example, the signed binary number11111001 is
negative because the leftmost bit is 1. Its 2s-
complement is 00000111, which is the binary
equivalent of +7. Therefore, we conclude that the
original negative number is -7
Subtraction of two signed binary numbers when negative numbers
are in 2s-complement form is stated as follows:
Take the 2s-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

This procedure works because a subtraction operation can be


changed to an addition operation if the sign of the subtrahend is
changed as in the following:
+ = +
= + +
Changing a positive number to a negative number is easily
done by taking the 2s-complement of the positive number
The reverse is also true, because the complement of a negative
number (that is already in complement form) produces the
equivalent positive number
For example, consider the following subtraction:
6 13 = +7
In binary with eight bits, we can re-write this operation as:
1111 1010 1111 0011
The subtraction is changed to addition by taking the 2s
complement of the subtrahend (13), giving (+13)
In binary, this corresponds to:
1111 1010 + 0000 1101 = 1 0000 0111
By removing the end carry, we obtain the correct answer:
0000 0111
which is equivalent to +7
Note that binary numbers in signed-complement system are added
and subtracted by the same basic addition and subtraction rules as
unsigned numbers
Thus, computers need only one common hardware circuit to
handle both types of arithmetic
This consideration resulted in the signed-complement system being
used in all almost all arithmetic units of computer systems
We have agreed that computers and digital systems
understand only binary digits: 0s or 1s
However, we should note that we dont just deal with
and store binary numbers, we code all information in
terms of binary codes
Binary codes are patterns of 0s and 1s
Different patterns of bits are used to represent different
elements of information
An n-bit binary code can represent information with up
to 2 distinct combinations
For example, with 2 bits (that is, = 2), we are able to
code a set of four elements, with each element assigned
a distinct pattern of bits: 00, 01, 10, 11
Also, we can see that a set of 8 elements requires a 3-
bit code, and a set of 16 elements requires a 4-bit code,
and so on
Although we can easily convert from decimal to binary,
dealing with decimals is easier because we are used to
it
We will use binary codes to represent decimal numbers
Note that we will not convert from decimal to binary.
Instead, we will represent each decimal digit (from 0 to
9) in a unique way with patterns of bits
This type of coding is referred to as Binary-Coded
Decimal (BCD)
BCD represents each decimal digit in groups of 4 bits
The decimal digits from 0 to 9 have the codes 0000 to 1001,
similar to what we get when we convert them to binary
The difference appears when we want to code the numbers
from 10 and beyond
For example, the decimal 10 , if we convert it to binary we
get 1010, but in BCD it is represented as 00010000
That is, each digit is represented by its corresponding BCD
code
Another example, the decimal 185 is equivalent to
(10111001)2 while in BCD it is written as 000110000101
Thus, we have highly simplified the process of
representing decimal numbers in patterns of binary bits
However, the expense is that we need more bits for
BCD numbers: notice that the decimal 10 requires 8
bits when represented in BCD, while 4 bits are needed
to convert it to a binary number
Note that the binary combinations 1010 through
1111are not used and have no meaning in BCD
You should keep in mind that BCD numbers are
decimal numbers and NOT binary numbers, although
they use bits in their representation
The only difference between BCD numbers and
decimal numbers is that they use different symbols to
represent the digits. But the decimal value is exactly the
same
When adding two BCD numbers, if the sum is 1001
or less, the resulting sum will be a correct BCD
number
However, when the sum is 1010 or bigger, the result
is an invalid BCD digit
We will need to add 6 = (0110)2 to the binary
answer to get the correct BCD representation
We add 6 to skip the six invalid states of BCD (that
is, from 10 to 15) and return to the valid BCD codes
For example

Whenever the binary sum is equal to or greater than


1010, we should add 0110 to get the correct BCD sum
The addition of two n-digit unsigned BCD numbers
follows the same procedure
The representation of signed numbers in BCD is similar to that in
binary
Both the signed-magnitude and the signed-complement systems
can be used
The sign of a decimal number is usually represented with four
bits to conform to the 4-bit code used in BCD
Note, however, while the +ve sign is designated with four 0s,
the ve sign is designated with 1001 (which is 9 in BCD)
When dealing with BCD codes, the signed-10s complement
system is mostly used in computers
Addition and subtraction of BCD numbers using the signed-10s
complement system is exactly similar to what we have done last
lecture with decimal and binary numbers
Codes other than BCD are also possible
2421
Excee-3
8,4,-2,-1
Similar to BCD, with = 4 bits, we have 24 = 16
possible combinations, but only the first 10
combinations are used. The remaining 6 have no
meaning and should not be used
BCD (8421) and 2421 are known as weighted codes
BCD has weights 8, 4, 2, and 1
The 2421 and the excess-3 codes are referred to as self-
complementing codes
These codes have the property that the 9s complement of a
decimal number is obtained directly by changing 1s to 0s and
vice versa
For example, decimal 395 is represented in excess-3 as
0110 1100 1000. Its 9s complement is 604, which is
found simply by complementing each bit: 1001 0011
0111
Excess-3 is un-weighted code in which each coded
combination is obtained from the corresponding binary
value plus 3
So, no weights are used for the digits positions
Note that BCD is not self-complementing
The 8, 4, 2, 1 code is an example of assigning both
+ ve and ve weights to a decimal code
Here, 0110 is interpreted as decimal 2 and is calculated from
() 0 + () 1 + 1 + 0 = 2
Output data of many physical systems are quantities
that are continuous
These data must be converted into digital form before
they are applied to a digital system
Continuous (analog) information is converted into
digital form by means of analog-to-digital converter
Gray code is used with data that have been converted
from analog to digital
The advantage of this code is that only one bit in the
code group changes in going from one number to the
next
For example, in going from 7 to 8, the Gray code
changes from 0100 to 1100. In contrast, with binary
numbers we would go from 0111 to 1000, which requires
all four bits to change
This feature is useful in applications where the normal
sequence of generated binary numbers may produce an
error during transition from one number to the next
With binary numbers, a change from 0111 to 1000 may
produce an erroneous number 1001 if the rightmost bit
takes longer to change than do the other three bits
This could harm the machine using this information
seriously
With Gray code, this issue is resolved, since it assures
that only one bit is to be changed during any transition
between two numbers
Digital systems not only deal with numbers, but with other
symbols too (like letters and alphabet)
The standard binary code for alphanumeric characters is the
American Standard Code for Information Interchange (ASCII)
It uses seven bits to code 128 characters
The ASCII code also contains characters that can be printed and
other nonprinting characters used for various control functions
ASCII uses 7 bits, but computers deal with bytes (8 bits),
therefore, an ASCII character is stored in an 8-bit cell.
The extra bit may be used for other purposes depending on the
application.
For example: some applications may store a value of 1 in the most
significant position to indicate that the characters are for Greek alphabet
Sometimes, an eighth bit is added to the ASCII
character to indicate its parity
A parity bit is an extra bit included with a message to
make the total number of 1s either even or odd
For example:

We add an extra bit in the leftmost position to produce


an even number of 1s (even parity) or an odd number
of 1s (odd parity)
The parity bit is useful in detecting errors during the
transmission of information form one location to another
The parity of each character sent to a destination is checked
by the receiver
Assuming that even parity is implemented, if the receiver
finds that the number of 1s in the received characters is
odd, then it concludes that at least one bit has changed
during transmission
Of course, if multiple bits have changed, the even parity check
wouldnt work
If an error is detected, the receiver may request the
transmitter to re-send the message
Digital computers store binary information in binary
cells
A binary cell is a device that always has one of two
states and is capable of storing one bit (0 or 1) of
information
A register is a group of cells
A register with n cells can store any discrete quantity of
information that contains n bits
The content of the register can be interpreted in
different ways depending on what the bits refer to
For example, if a 16-bit register has the following binary content:
1100001111001001
We may assume that the register is storing a binary number that
is equivalent to decimal 50121
Instead, if we assume that the register is storing ASCII
alphanumeric characters (with even parity), then the content is

Also, we may view the content as being for four-digit decimal
numbers
In excess-3 code, the content refers to decimal 9096
In BCD, the content is meaningless because 1100 is unused combination
in BCD
So the same content may be interpreted differently depending on
the application
A digital system is characterized by its registers and the
components that perform data processing
In digital systems, a register transfer operation is a
basic operation that consists of a transfer of binary
information from one set of registers into another set of
registers
The transfer may be direct, from one register to
another, or may pass through dataprocessing circuits to
perform an operation
We illustrate the transfer of
information among registers
and demonstrate pictorially
the transfer of binary
information from a keyboard
into a register in the memory
unit
The input unit is assumed to
have a keyboard, a control
circuit, and an input register.
Each time a key is struck, the control circuit enters an equivalent 8bit
alphanumeric character code into the input register
We shall assume that the code used is the ASCII code with an
oddparity bit
The information from the input register is transferred into the eight
least significant cells of a processor register
After every transfer, the input register is cleared to enable the control to
insert a new 8bit code when the keyboard is struck again
Each 8bit character transferred to the processor register is preceded by
a shift of the previous character to the next eight cells on its left
When a transfer of four characters is completed, the processor register
is full, and its contents are transferred into a memory register
To process discrete quantities of information in binary
form, a computer must be provided with devices that
hold the data to be processed and with circuit elements
that manipulate individual bits of information
The device most commonly used for holding data is
a register
Binary variables are manipulated by means of digital
logic circuits
The process of adding two 10bit binary numbers is now
illustrated
The memory unit is shown with only three of its registers
R1, R2, and R3
Also, we show the digital logic circuits that manipulate the
bits of R1 and R2 and transfer into R3 a binary number
equal to their arithmetic sum
Memory registers store information and are incapable of
processing the two operands
However, the information stored in memory can be
transferred to processor registers, and the results obtained in
processor registers can be transferred back into a memory
register for storage until needed again
The diagram shows the contents of two operands
transferred from two memory registers into R1 and R2
The digital logic circuits produce the sum, which is
transferred to register R3
The contents of R3 can now be transferred back to one of
the memory registers
The last two examples demonstrated the informationflow
capabilities of a digital system in a simple manner
The registers of the system are the basic elements for
storing and holding the binary information
Digital logic circuits process the binary information stored
in the registers
It is apparent that registers are basic elements used for
storing and holding data (binary information) that will
be processed by the computer
Binary logic deals with:
Variables that take on two values (in our case, 0 and 1) , and
Operations that assume logical meaning
This binary logic will be called Boolean algebra
Binary logic deals with binary variables denoted by letters, such
as A, B, x, yetc. Each variable can have only one of two
possible values: 0 and 1
Binary logic deals with three basic logical operations: AND, OR,
and NOT
AND
Denoted by a dot (or an absence of an operator)
Example: . = is read as x AND y is equal to z. It can
also be written as =
OR
Denoted by a plus sign
Example: + = is read as x OR y is equal to z
NOT
Denoted by a prime (or an overbar)
Example: = is read as NOT x is equal to z. It can also
be written as =
Binary logic resembles binary arithmetic, and the
operations AND and OR have similarities to
multiplications and addition, respectively
HOWEVER, binary logic should not be confused
with binary arithmetic, for example
Binary arithmetic: 1 + 1 = 10 (read as: 1 plus 1 is equal to
2)
Binary logic: 1 + 1 = 1 (read as: 1 OR 1 is equal to 1)
Logical operations are best described by truth tables
Logic gates are electronic circuits that operate on one
or more input signals to produce an output signal
The graphic symbols used to designate the three types
of gates are shown below
It is sometimes useful to draw timing diagrams that
show the relationship between the inputs to a logic gate
and the generated output

You might also like