0% found this document useful (0 votes)
93 views10 pages

Chapter 1

1) Signed binary numbers can represent positive and negative integers. Negative numbers are represented using either the signed-magnitude or signed-complement systems. 2) In signed-complement representation, negative numbers are obtained by taking the 1's or 2's complement of the positive number. The 2's complement is more commonly used. 3) Addition and subtraction of signed binary numbers follows simple rules when using the signed-complement system. The numbers are added or subtracted together, including the sign bits, with overflow discarded. This allows the same hardware to perform both addition and subtraction.

Uploaded by

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

Chapter 1

1) Signed binary numbers can represent positive and negative integers. Negative numbers are represented using either the signed-magnitude or signed-complement systems. 2) In signed-complement representation, negative numbers are obtained by taking the 1's or 2's complement of the positive number. The 2's complement is more commonly used. 3) Addition and subtraction of signed binary numbers follows simple rules when using the signed-complement system. The numbers are added or subtracted together, including the sign bits, with overflow discarded. This allows the same hardware to perform both addition and subtraction.

Uploaded by

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

SIGNED BINARY NUMBERS there is only one way to represent +9, there are three

different ways to represent - 9 with eight bits:


Positive integers including zero can be
represented as unsigned numbers. However, to
represent negative integers, we need a notation for
negative values. In ordinary arithmetic, a negative
number is indicated by a minus sign and a positive
number by a plus sign. Because of hardware
limitations, computers must represent everything with
binary digits, commonly referred to as bits. It is
customary to represent the sign with a bit placed in the In signed-magnitude, -9 is obtained from +9 by
leftmost position of the number. The convention is to changing the sign bit in the-leftmost position from 0 to
make the sign bit 0 for positive and 1 for negative. 1. In signed-1's complement, -9 is obtained by
complementing all the bits of +9, including the sign bit.
It is important to realize that both signed and
The signed-2's-complement representation of -9 is
unsigned binary numbers consist of a string of bits
obtained by taking the 2's complement of the positive
when represented in a computer. The user determines
number, including the sign bit.
whether the number is signed or unsigned. If the binary
number is signed, then the leftmost bit represents the The signed-magnitude system is used in
sign and the rest of the bits represent the number. If ordinary arithmetic, but is awkward when employed in
the binary number is assumed to be unsigned, then the computer arithmetic. Therefore, the signed-
leftmost bit is the most significant bit of the number. For complement is normally used. The 1's complement
example, the string of bits 01001 can be considered as imposes some difficulties and is seldom used for
9 (unsigned binary) or a +9 (signed binary) because arithmetic operations except in some older computers.
the leftmost bit is 0. The string of bits 11001 represent The 1's complement is useful as a logical operation
the binary equivalent of 25 when considered as an since the change of 1 to 0 or 0 to 1 is equivalent to a
unsigned number or as - 9 when considered as a logical complement operation, as will be shown in the
signed number because of the 1 in the leftmost next chapter. The following discussion of signed binary
position, which designates negative, and the other four arithmetic deals exclusively with the signed-2's-
bits, which represent binary 9. Usually, there is no complement representation of negative numbers. The
confusion in identifying the bits if the type of same procedures can be applied to the signed-1's-
representation for the number is known in advance. complement system by including the end-around carry
as done with unsigned numbers.
The representation of the signed numbers in
the last example is referred to as the signed-magnitude ARITHMETIC ADDITION
convention. In this notation, the number consists of a
magnitude and a symbol (+ or -) or a bit (0 or 1) The addition of two numbers in the signed-
indicating the sign. This is the representation of signed magnitude system follows the rules of ordinary
numbers used in ordinary arithmetic. When arithmetic arithmetic. If the signs are the same, we add the two
operations are implemented in a computer, it is more magnitudes and give the sum the common sign. If the
convenient to use a different system for representing signs are different, we subtract the smaller magnitude
negative numbers, referred to as the signed- from the larger and give the result the sign of the larger
complement system. In this system, a negative number magnitude. For example, (+25) + ( - 37) = -(37 - 25) = -
is indicated by its complement. Whereas the signed- 12 and is done by subtracting the smaller magnitude
magnitude system negates a number by changing its 25 from the larger magnitude 37 and using the sign of
sign, the signed-complement system negates a 37 for the sign of the result. This is a process that
number by taking its complement. Since positive requires the comparison of the signs and the
numbers always start with 0 (plus) in the leftmost magnitudes and then performing either addition or
position, the complement will always start with a 1, subtraction. The same procedure applies to binary
indicating a negative number. The signed-complement numbers in signed-magnitude representation. In
system can use either the 1's or the 2's complement, contrast, the rule for adding numbers in the signed-
but the 2's complement is the most common. complement system does not require a comparison or
subtraction, but only addition. The procedure is very
As an example, consider the number 9 simple and can be stated as follows for binary
represented in binary with eight bits. +9 is represented numbers.
with a sign bit of 0 in the leftmost position followed by
the binary equivalent of 9 to give 00001001. Note that The addition of two signed binary numbers
all eight bits must have a value and, therefore, 0's are with negative numbers represented in signed-2's-
inserted following the sign bit up to the first 1. Although complement form is obtained from the addition of the
two numbers, including their sign bits. A carry out of (including the sign bit). A carry out of the sign-bit
the sign-bit position is discarded. position is discarded.

Numerical examples for addition follow. Note This procedure occurs because a subtraction
that negative numbers must be initially in 2's operation can be changed to an addition operation if
complement and that the sum obtained after the the sign of the subtrahend is changed. This is
addition if negative is in 2's-complement form.

demonstrated by the following relationship:

But changing a positive number to a negative


number is easily done by taking its 2's complement.
The reverse is also true because the complement of a
negative number in complement form produces the
equivalent positive number. Consider the subtraction of
In each of the four cases, the operation (-6) - (-13) = +7. In binary with eight bits, this is written
performed is addition with the sign bit included. Any as (11111010 - 11110011). The subtraction is changed
carry out of the sign-bit position is discarded, and to addition by taking the 2's complement of the
negative results are automatically in 2's-complement subtrahend (-13) to give (+13). In binary, this is 11
form. 111010 + 00001101 = 10000011 1. Removing the end
carry, we obtain the correct answer 00000111 (+7).
In order to obtain a correct answer, we must
ensure that the result has a sufficient number of bits to It is worth noting that binary numbers in the
accommodate the sum. If we start with two n-bit signed-complement system are added and subtracted
numbers and the sum occupies n + I bits, we say that by the same basic addition and subtraction rules as
an overflow occurs. When one performs the addition unsigned numbers. Therefore, computers need only
with paper and pencil, an overflow is not a problem one common hardware circuit to handle both types of
since we are not limited by the width of the page. We arithmetic. The user or programmer must interpret the
just add another 0 to a positive number and another I results of such addition or subtraction differently,
to a negative number in the most-significant position to depending on whether it is assumed that the numbers
extend them to n + I bits and then perform the addition. are signed or unsigned.
Overflow is a problem in computers because the
number of bits that hold a number is finite, and a result
that exceeds the finite value by I cannot be BINARY CODES
accommodated.
Electronic digital systems use signals that have
The complement form of representing negative two distinct values and circuit elements that have two
numbers is unfamiliar to those used to the signed- stable states. There is a direct analogy among binary
magnitude system. To determine the value of a signals, binary circuit elements, and binary digits. A
negative number when in signed- 2' s complement, it is binary number of n digits, for example, may be
necessary to convert it to a positive number to place it represented by n binary circuit elements, each having
in a more familiar form. For example, the signed binary an output signal equivalent to a 0 or a 1. Digital
number 11111001 is negative because the leftmost bit systems represent and manipulate not only binary
is 1. Its 2's complement is 00000111, which is the numbers, but also many other discrete elements of
binary equivalent of + 7. We therefore recognize the information. Any discrete element of information
original negative number to be equal to -7. distinct among a group of quantities can be
represented by a binary code. Binary codes play an
important role in digital computers. The codes must be
ARITHMETIC SUBSTRACTION in binary because computers can only hold I's and O's.
It must be realized that binary codes merely change
Subtraction of two signed binary numbers the symbols, not the meaning of the elements of
when negative numbers are in 2's-complement form is information that they represent. If we inspect the bits of
very simple and can be stated as follows: a computer at random, we will find that most of the time
they represent some type of coded information rather
Take the 2's complement of the subtrahend
than binary numbers.
(including the sign bit) and add it to the minuend
A bit, by definition, is a binary digit. When used assign weights to the binary bits according to their
in conjunction with a binary code, it is better to think of positions. The weights in the BCD code are 8, 4, 2, I.
it as denoting a binary quantity equal to 0 or I. To The bit assignment 0110, for example, can be
represent a group of 2" distinct elements in a binary interpreted by the weights to represent the decimal
code requires a minimum of n bits. This is because it is digit 6 because a x 8 + 1 x 4 + I X 2 + 0 X I = 6. It is
possible to arrange n bits in 2" distinct ways. For also possible to assign negative weights to a decimal
example, a group of four distinct quantities can be code, as shown by the 8, 4, -2, -I code. In this case, the
represented by a two-bit code, with each quantity bit combination 0110 is interpreted as the decimal digit
assigned one of the following bit combinations: 00, 01, 2, as obtained from 0 X 8 + I X 4 + I X (-2) + 0 X (-I) =
10, 11. A group of eight elements requires a three-bit 2. Two other weighted codes shown in the table are the
code, with each element assigned to one and only one 2421 and the 5043210. A decimal code that has been
of the following: 000, 001, 010, all, 100, 101, 110, 111. used in some old computers is the excess-3 code. This
The examples show that the distinct bit combinations of is an unweighted code; its code assignment is obtained
an n-bit code can be found by counting in binary from a from the corresponding value of BCD after the addition
to (2" ~ I). Some bit combinations are unassigned of 3.
when the number of elements of the group to be coded
Numbers are represented in digital computers
is not a multiple of the power of 2. The ten decimal
either in binary or in decimal through a binary code.
digits 0, 1, 2, ... , 9 are an example of such a group. A
When specifying data, the user likes to give the data in
binary code that distinguishes among ten elements
decimal form. The input decimal numbers are stored
must contain at least four bits; three bits can
internally in the computer by means of a decimal code.
distinguish a maximum of eight elements. Four bits can
Each decimal digit requires at least four binary storage
form 16 distinct combinations, but since only ten digits
elements. The decimal numbers are converted to
are coded, the remaining six combinations are
binary when arithmetic operations are done internally
unassigned and not used.
with numbers represented in binary. It is also possible
Although the minimum number of bits required to perform the arithmetic operations directly in decimal
to code 2" distinct quantities is n, there is no maximum with all numbers left in a coded form throughout. For
number of bits that may be used for a binary code. For example, the decimal number 395, when converted to
example, the ten decimal digits can be coded with ten binary, is equal to 110001011 and consists of nine
bits, and each decimal digit assigned a bit combination binary digits. The same number, when represented
of nine 0'5 and a I. In this particular binary code, the internally in the BCD code, occupies four bits for each
digit 6 is assigned the bit combination 0001000000. decimal digit, for a total of 12 bits: 001110010101. The
first four bits represent a 3, the next four a 9, and the
last four a 5.
DECIMAL CODES
It is very important to understand the difference
Binary codes for decimal digits require a between conversion of a decimal number to binary and
minimum of four bits. Numerous different codes can be the binary coding of a decimal number. In each case,
obtained by arranging four or more bits in ten distinct the final result is a series of bits. The bits obtained from
possible combinations. A few possibilities are shown in conversion are binary digits. Bits obtained from coding
Table 1-2. are combinations of I's and O's arranged according to
the rules of the code used. Therefore, it is extremely
important to realize that a series of I's and O's in a
digital system may sometimes represent a binary
number and at other times represent some other
discrete quantity of information as specified by a given
binary code. The BCD code, for example, has been
chosen to be both a code and a direct binary
conversion, as long as the decimal numbers are
integers from 0 to 9. For numbers greater than 9, the
conversion and the coding are completely different.
This concept is so important that it is worth repeating
with another example. The binary conversion of
decimal 13 is 1101; the coding of decimal 13 with BCD
is 00010011.

The BCD (binary-code decimal) is a straight


assignment of the binary equivalent. It is possible to
From the five binary codes listed in Table 1-2,
the BCD seems the most natural to use and is indeed
the one most commonly encountered. The other four-
bit codes listed have one characteristic in common that
is not found in BCD. The excess-3, the 2,4, 2, I, and
the 8, 4, -2, -I are self-complementing codes, that is,
the 9's complement of the decimal number is easily
obtained by changing I's to O's and O's to I's. For
example, the decimal 395 is represented in the 2, 4, 2,
I code by 001111111011. Its 9's complement 604 is
represented by 110000000100, which is easily
obtained from the replacement of I's by O's and O's by
I's. This property is useful when arithmetic operations
are internally done with decimal numbers (in a binary
code) and subtraction is calculated by means of 9's
complement.

The biquinary code shown in Table 1-2 is an


example of a seven-bit code with errordetection together with the parity bit, is transmitted to its
properties. Each decimal digit consists of five D's and destination. The parity of the received data is
two I's placed in the corresponding weighted columns.
The error-detection property of this code may be
understood if one realizes that digital systems
represent binary I by one distinct signal and binary 0 by
a second distinct signal. During transmission of signals
from one location to another. an error may occur. One
or more bits may change value. A circuit in the
receiving side can detect the presence of more (or
less) than two I's and if the received combination of bits
checked in the receiving end. If the parity of
does not agree with the allowable combination, an
the received information is not even, it means that at
error is detected.
least one bit has changed value during the
transmission. This method detects one, three, or any
odd combination of errors in each message that is
ERROR-DETECTION CODE transmitted. An even combination of errors is
Binary information can be transmitted from one location undetected. Additional error-detection schemes may be
to another by electric wires or other communication needed to take care of an even combination of errors.
medium. Any external noise introduced into the
physical communication medium may change some of
the bits from 0 to I or vice versa. The purpose of an What is done after an error is detected
error-detection code is to detect such bit-reversal depends on the particular application. One possibility is
errors. One of the most common ways to achieve error to request retransmission of the message on the
detection is by means of a parity bit. A parity bit is an assumption that the error was random and will not
extra bit included with a message to make the total occur again. Thus, if the receiver detects a parity error,
number of l' s transmitted either odd or even. A it sends back a negative acknowledge message. If no
message of four bits and a parity bit P are shown in error is detected, the receiver sends back an
Table 1-3. If an odd parity is adopted, the P bit is acknowledge message. The sending end will respond
chosen such that the total number of 1 's is odd in the to a previous error by transmitting the message again
five bits that constitute the message and P. If an even until the correct parity is received. If, after a number of
parity is adopted, the P bit is chosen so that the total attempts, the transmission is still in error, a message
number of I's in the five bits is even. In a particular can be sent to the human operator to check for
situation, one or the other parity is adopted, with even malfunctions in the transmission path.
parity being more common.

The parity bit is helpful in detecting errors


during the transmission of information from one GRAY CODE
location to another. This is done in the following Digital systems can be designed to process
manner. An even parity bit is generated in the sending data in discrete form only. Many physical systems
end for each message transmission. The message,
supply continuous output data. These data must be Many applications of digital computers require
converted into digital form before they are applied to a
digital system. Continuous or analog information is
converted into digital form by means of an analog-to-
digital converter. It is sometimes convenient to use the
Gray code shown in Table 1-4 to represent the digital
data when it is converted from analog data. The
advantage of the Gray code over binary numbers is
that only one bit in the code group changes when going
from one number to the next. For example, in going
from 7 to 8, the Gray code changes from OJ 00 to
1100. Only the

the handling of data not only of numbers, but also of


letters. For instance, an insurance company with
thousands of policy holders will use a computer to
process its files. To represent the names and other
pertinent information, it is necessary to formulate a
binary code for the letters of the alphabet. In addition,
the same binary code must represent numerals and
special characters such as $. An alphanumeric
character set is a set of elements that includes the 10
decimal digits, the 26 letters of the alphabet, and a
number of special characters. Such a set contains
between 36 and 64 elements if only capital letters are
included, or between 64 and 128 elements if both
uppercase and lowercase letters are included. In the
first bit from the left changes from 0 to 1; the other first case, we need a binary code of six bits, and in the
three bits remain the same. When comparing this with second we need a binary code of seven bits.
binary numbers, the change from 7 to 8 will be from
0111 to 1000, which causes all four bits to change The standard binary code for the alphanumeric
values characters is ASCII (American Standard Code for
Information Interchange). It uses seven bits to code
The Gray code is used in applications where 128 characters, as shown in Table 1-5. The seven bits
the normal sequence of binary numbers may produce of the code are designated by b 1 through b1, with b1
an error or ambiguity during the transition from one being the most-significant bit. The letter A, for example,
number to the next. If binary numbers are used, a is represented in ASCII as 1000001 (column 100, row
change from 0111 to 1000 may produce an 0001). The ASCII code contains 94 graphic characters
intermediate erroneous number 1001 if the rightmost that can be printed and 34 nonprinting characters used
bit takes more time to change than the other three bits. for various control functions. The graphic characters
The Gray code eliminates this problem since only one
bit changes in value during any transition between two
numbers.

A typical application of the Gray code occurs


when analog data are represented by continuous
change of a shaft position. The shaft is partitioned into
segments, and each segment is assigned a number. If
adjacent segments are made to correspond with the
Gray-code sequence, ambiguity is eliminated when
detection is sensed in the line that separates any two
segments.

ASCII CHARACTER CODE


consist of the 26 uppercase letters (A through Z), the characters has the advantage of reducing the space
26 lowercase letters (a through z), the 10 numerals (0 needed to store large quantities of alphanumeric data.
through 9), and 32 special printable characters such as
A code developed in the early stages of
%, *, and $.
teletype transmission is the 5-bit Baudot code.
The 34 control characters are designated in Although five bits can specify only 32 characters, the
the ASCII table with abbreviated names. They are Baudot code represents 58 characters by using two
listed in the table with their full functional names. The modes of operation. In the mode called letters, the five
control characters are used for routing data and bits encode the 26 letters of the alphabet. In the mode
arranging the printed text into a prescribed format. called figures, the five bits encode the numerals and
There are three types of control characters; format other characters. There are two special characters that
effectors, information separators, and communication- are recognized by both modes and used to shift tram
control characters. Format effectors are characters that one mode to the other. The letter-shift character places
control the layout of printing. They include the familiar the reception station in the letters mode, after which all
typewriter controls such as backspace (BS), horizontal subsequent character codes are interpreted as letters.
tabulation (HT), and carriage return (CR). Information The figure-shift character places the system in the
separators are used to separate the data into divisions ligures mode. The shift operation is analogous to the
such as paragraphs and pages. They include shifting operation on a typewriter with a shift lock key.
characters such as record separator (RS) and file
When alphanumeric information is transferred
separator (FS). The communication-control characters
to the computer using punched cards, the
are useful during the transmission of text between
alphanumeric characters are coded with 12 bits.
remote terminals. Examples of communication-control
Programs and data in the past were prepared on
characters are STX (start of text) and ETX (end of
punched cards using the Hollerith code. A punched
text), which are used to frame a text message when
card consists of 80 columns and 12 rows. Each column
transmitted through telephone wires.
represents an alphanumeric character of 12 bits with
ASCII is a 7 -bit code, but most computers holes punched in the appropriate rows. A hole is
manipulate an 8-bit quantity as a single unit called a sensed as a I and the absence of a hole is sensed as a
byte. Therefore, ASCII characters most often are O. The 12 rows are marked, starting from the top, as
stored one per byte. The extra bit is sometimes used 12, II, 0, 1, 2, ..., 9. The first three are called the zone
for other purposes, depending on the application. For punch and the last nine are called the numeric punch.
example, some printers recognize 8-bit ASCII Decimal digits are represented by a single hole in a
characters with the most-significant bit set to O. numeric punch. The letters of the alphabet are
Additional 128 8-bit characters with the most-significant represented by two holes in a column, one in the zone
bit set to I are used for other symbols such as the punch and the other the numeric punch. Special
Greek alphabet or italic type font. When used in data characters are "represented by one, two, or three holes
communication, the eighth bit may be employed to in a column. The 12-bit card code is inefficient in its
indicate the parity of the character use of bits. Consequently, computers that receive input
from a card reader convert the input 12-bit card code
OTHER ALPHANUMERIC CODES into an internal six-bit code to conserve bits of storage.
Another alphanumeric code used in IBM BINARY STORAGE AND REGISTERS
equipment is the EBCDIC (Extended BinaryCoded
Decimal Interchange Code). It uses eight bits for each The discrete elements of information in a
character. EBCDIC has the same character symbols as digital computer must have a physical existence in
ASCII, but the bit assignment for characters is different. some information-storage medium. Furthermore, when
As the name implies, the binary code for the letters and discrete elements of information are represented in
numerals is an extension of the binary-coded decimal binary form, the information-storage medium must
(BCD) code. This means that the last four bits of the contain binary storage elements for storing individual
code range from 0000 though 1001 as in BCD. bits. A binary cell is a device that possesses two stable
states and is capable of storing one bit of information.
When characters are used internally in a
The input to the cell receives excitation signals that set
computer for data processing (not for transmission
it to one of the two states. The output of the cell is a
purposes), it is sometimes convenient to use a 6-bit
physical quantity that distinguishes between the two
code to represent 64 characters. A 6-bit code can
states. The information stored in a cell is a I when it is
specify 64 characters consisting of the 26 capital
in one stable state and a 0 when in the other stable
letters, the 10 numerals, and up to 28 special
state. Examples of binary cells are electronic flip-flop
characters. This set of characters is usually sufficient
circuits, ferrite cores used in memories, and positions
for data-processing purposes. Using fewer bits to code
punched with a hole or not punched in a card.
Registers and every input or output device must have at least
one register to store the information transferred to or
A register is a group of binary cells. Since a from the device. An interregister transfer operation, a
cell stores one bit of information, it follows that a basic operation in digital systems, consists of a transfer
register with n cells can store any discrete quantity of of the information stored in one register into another.
information that contains n bits. The state of a register Figure 1-2 illustrates the transfer of information among
is an n-tuple number of I's and O's, with each bit registers and demonstrates pictorially the transfer of
designating the state of one cell in the register. The binary information from a keyboard into a register in the
content of a register is a function of the interpretation memory unit. The input unit is assumed to have a
given to the information stored in it. Consider, for keyboard, a control circuit, and an input register. Each
example, the following 16-cell register: time a key is struck, the control enters into the input
register an equivalent eight-bit alphanumeric character
code. We shall assume that the code used is the ASCII
code with an odd-parity eighth 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
Physically, one may think of the register as control to insert a new eight-bit code when the
composed of 16 binary cells, with each cell storing keyboard is struck again. Each eight-bit character
either a I or a O. Suppose that the bit configuration transferred to the processor register is preceded by a
stored in the register is as shown. The state of the shift of the previous character to the next eight cells on
register is the 16-tuple number 1100001111001001. its left. When a transfer of four characters is completed,
Clearly, a register with n cells can be in one of 2" the processor register is full, and its contents are
possible states. Now, if one assumes that the content transferred into a memory register. The content stored
of the register represents a binary integer, then in the memory register shown in Fig. 1-2 came from the
obviously the register can store any binary number transfer of the characters JOHN after the four
from 0 to 2" - I. For the particular example shown, the appropriate keys were struck.
content of the register is the binary equivalent of the
decimal number 50121. If it is assumed that the To process discrete quantities of information in
register stores alphanumeric characters of an eight-bit binary form, a computer must be provided with (1)
code, the content of the register is any two meaningful devices that hold the data to be processed and (2)
characters. For the ASCII code with an even parity circuit elements that manipulate individual bits of
placed in the eighth most-significant bit position the information. The device most commonly used for
previous example represents the two characters C (left holding data is a register. Manipulation of binary
eight bits) and I (right eight bits). On the other hand, if variables is done by means of digital logic circuits.
one interprets the content of the register to be four Figure 1-3 illustrates the process of adding two IO-bit
decimal digits represented by a four-bit code, the binary numbers. The memory unit, which normally
content of the register is a four-digit decimal number. In consists of thousands of registers, is shown in the
the excess-3 code, the previous example is the
decimal number 9096. The content of the register is
meaningless in BCD since the bit combination 1100 is
not assigned to any decimal digit. From this example, it
is clear that a register can store one or more discrete
elements of information and that the same bit
configuration may be interpreted differently for different
types of elements of information. It is important that the
user store meaningful information in registers and that
the computer be programmed to process this
information according to the type of information stored.

Register Transfer
A digital computer is characterized by its
registers. The memory unit (Fig. 1-1) is merely a
collection of thousands of registers for storing digital
information. The processor unit is composed of
various registers that store operands upon which
operations are performed. The control unit uses
registers to keep track of various computer sequences,
diagram with only three of its registers. The whose behavior is most conveniently expressed by
part of the processor unit shown consists of three means of binary variables and logical operations. The
registers, Rl, R2, and R3, together with digital logic binary logic to be introduced in this section is
circuits that manipulate the bits of Rl and R2 and equivalent to an algebra called Boolean algebra. The
transfer into R3 a binary number equal to their formal presentation of a two-valued Boolean algebra is
arithmetic sum. Memory registers store information and covered in more detail in Chapter 2. The purpose of
are incapable of processing the two operands. this section is to introduce Boolean algebra in a
However, the information stored in memory can be heuristic manner and relate it to digital logic circuits
transferred to processor registers. Results obtained in and binary signals.
processor registers can be transferred back into a
memory register for storage until needed again. The Definition of Binary Logic
diagram shows the contents of two operands
Binary logic consists of binary variables and
transferred from two memory registers into Rl and R2.
logical operations. The variables are designated by
The digital logic circuits produce the sum, which is
letters of the alphabet such as A, B, C, x, y, Z, etc.,
transferred to register R3. The contents of R3 can now
with each variable having two and only two distinct
be transferred back to one of the memory registers.
possible values: I and O. There are three basic logical
The last two examples demonstrated the operations: AND, OR, and NOT.
information-flow capabilities of a digital system in a
1. AND: This operation is represented by a
very simple manner. The registers of the system are
the basic elements for storing and holding the binary dot or by the absence of an operator. For
information. The digital logic circuits process the example, x·y = z or xy = Z is read "x AND y
information. Digital logic circuits and their manipulative is equal to z." The logical operation AND is
capabilities are introduced in the next section. interpreted to mean that z = I if and only if
Registers and memory are presented in Chapter 7. x = I and y = I; otherwise, z = O.
(Remember that x, y, and z are binary
variables and can be equal either to I or 0,
and nothing else.)

2. OR: This operation is represented by a


plus sign. For example, x + y = z is read "x
OR y is equal to z," meaning that z = I if x
= I or if y = I or if both x = I and y = I. If both
x = 0 and y = 0, then z = 0.

3. NOT: This operation is represented by a


prime (sometimes by a bar). For example,
x' = z (or x = z) is read "not x is equal to z,"
meaning that z is what x is not. In other
words, if x = I, then z = 0; but if x = 0, then
z = 1.

Binary logic resembles binary arithmetic, and


the operations AND and OR have some similarities to
multiplication and addition, respectively. In fact, the
symbols used for AND and OR are the same as those
BINARY LOGIC
used for multiplication and addition. However, binary
Binary logic deals with variables that take on logic should not be confused with binary arithmetic.
two discrete values and with operations that assume One should realize that an arithmetic variable
logical meaning. The two values the variables take may designates a number that may consist of many digits. A
be called by different names (e.g., true and false, yes logic variable is always either a lora O. For example, in
and no, etc.), but for our purpose, it is convenient to binary arithmetic, we have I + I = 10 (read: "one plus
think in terms of bits and assign the values of I and O. one is equal to 2"), whereas in binary logic, we have I +
Binary logic is used to describe, in a mathematical way, I = I (read: "one OR one is equal to one")
the manipulation and processing of binary information.
For each combination of the values of x and y,
It is particularly suited for the analysis and design of
there is a value of z specified by the definition of the
digital systems. For example, the digital logic circuits of
logical operation. These definitions may be listed in a
Fig. 1-3 that perform the binary arithmetic are circuits
compact form using truth tables. A truth table is a table with a nominal value of 0 volt. As shown in Fig. 1-5,
of all possible combinations of the variables showing each voltage level has an acceptable deviation from
the relation between the values that the variables may the nominal. The intermediate region between the
take and the result of the operation. For example, the allowed regions is crossed only during state transitions.
truth tables for the operations AND and OR with The input terminals of digital circuits accept binary
variables x and yare obtained by listing all possible signals within the allowable tolerances and respond at
values that the variables may have when combined in the output terminal with binary signals that fall within
pairs. The result of the operation for each combination the specified tolerances.
is then listed in a separate row. The truth tables for
AND, OR. and NOT are listed in Table 1-6. These Logic Gates
tables clearly demonstrate the definition of the
Electronic digital circuits are also called logic
operations.
circuits because, with the proper input, they establish
logical manipulation paths. Any desired information for
computing or

Switching Circuits and Binary Signals


The use of binary variables and the application of
binary logic are demonstrated by the simple switching
circuits of Fig. 1-4. Let the manual switches A and B
represent two binary variables with values equal to 0
when the switch is open and I when the switch is
closed. Similarly, let the lamp L represent a third binary
variable equal to I when the light is on and 0 when off.
For the switches in series, the light turns on if A and B
are

closed. For the switches in parallel, the light turns on if


A or B is closed. It is obvious that the two circuits can
be expressed by means of binary logic with the AND
and OR operations, respectively:

control can be operated upon by passing


Electronic digital circuits are sometimes called
binary signals through various combinations of logic
switching circuits because they behave like a switch,
circuits, each signal representing a variable and
with the active element such as a transistor either
carrying one bit of information. Logic circuits that
conducting (switch closed) or not conducting (switch
perform the logical operations of AND, OR, and NOT
open). Instead of changing the switch manually, an
are shown with their symbols in Fig. 1-6. These
electronic switching circuit uses binary signals to
circuits, called gates, are blocks of hardware that
control the conduction or nonconduction state of the
produce a logic-lor logic-O output signal if input logic
active element. Electrical signals such as voltages or
requirements are satisfied. Note that four different
currents exist throughout a digital system in either one
names have been used for the same type of circuits:
of two recognizable values (except during transition).
digital circuits, switching circuits, logic circuits, and
Voltage-operated circuits, for example, respond to two
gates. All four names are widely used, but we shall
separate voltage levels, which represent a binary
refer to the circuits as AND, OR, and NOT gates. The
variable equal to logic-lor logic-O. For example, a
NOT gate is sometimes called an inverter circuit since
particular digital system may define logic-I as a signal
it inverts a binary signal. The input signals x and y in
with a nominal value of 3 volts and logic-O as a signal
the two-input gates of Fig. 1-6 may exist in one of four illustrate the response of each circuit to each of
possible states: 00,10,11, or 01. These input signals the four possible input binary combinations. The
are shown in Fig. 1-7, together with the output signals reason for the name "inverter" for the NOT gate is
for the AND and OR gates. The timing diagrams in Fig. apparent from a comparison of the signal x (input of
1-7 i]. inverter) and that of x' (output of inverter).

AND and OR gates may have more than two


inputs~ An AND gate with three inputs and an OR gate
with four inputs are shown in Fig~ l-6~ The three-input

AND gate responds with a logic-l output if all three


input signals are logic-l ~ The output produces a logic-
O signal if any input is logic-O~ The four-input OR gate
responds with a logic-I when any input is a logic-l ~ Its
output becomes logic-O if al\ input signals are logic-O.

The mathematical system of binary logic is


better known as Boolean, or switching, algebra~ This
algebra is conveniently used to describe the operation
of complex networks of digital circuits~ Designers of
digital systems use Boolean algebra to transform circuit
diagrams to algebraic expressions and vice versa~
Chapters 2 and 3 are devoted to the study of Boolean
algebra, its properties, and manipulative capabilities~
Chapter 4 shows how Boolean algebra may be used to
express mathematically the interconnections among
networks of gates.

You might also like