Professional Documents
Culture Documents
I. Digital Signal
In a digital system, the physical quantities or signals can assume only discrete
values, while in analog systems the physical quantities or signals may vary
continuously over a specified range. For example, the output voltage of a digital
system might be constrained to take on only two values such as 0 volts and 5 volts,
while the output voltage from an analog system might be allowed to assume any
value in the range −10 volts to +10 volts. Because digital systems work with discrete
quantities, in many cases they can be designed so that for a given input, the output
is exactly correct. For example, if we multiply two 5-digit numbers using a digital
multiplier, the 10-digit product will be correct in all 10 digits. On the other hand, the
output of an analog multiplier might have an error ranging from a fraction of one
percent to a few percent depending on the accuracy of the components used in
construction of the multiplier. Furthermore, if we need a product which is correct to
20 digits rather than 10, we can redesign the digital multiplier to process more digits
and add more digits to its input. A similar improvement in the accuracy of an analog
multiplier would not be possible because of limitations on the accuracy of the
components.
F= (.a−1 a−2 a−3 ・ ・ ・ a−m)R = a−1R−1 + a−2 R−2 + a−3 R−3 + ・ ・ ・ + a−m R−m
Multiplying by R yields
FR = a−1 + a−2 R−1 + a−3 R−2 + · · · + a−m R−m+1 = a−1 + F1
Where F1 represents the fractional part of the result and a−1 is the integer part.
Multiplying F1 by R yields:
F1R = a−2 + a−3 R−1 + · · · + a−m R−m+2 = a−2 + F2
Next, we multiply F2 by R:
F2R = a−3 + · · · + a−m R−m+3 = a−3 + F3
This process is continued until we have obtained a sufficient number of digits. Note
that the integer part obtained at each step is one of the desired digits and the most
significant digit is obtained first.
Example: Convert 0.62510 to binary.
This process does not always terminate, but if it does not terminate, the result is a
repeating fraction.
VI. Complements
There are two Type of Complements
a. Radix complements (r’s) b. Diminished radix complement (r-1)
Diminished radix complement (r-1):
Given a number N in base r having n digits, the (r–1)’s complement of N is defined as:
(r n –1) – N
Example: 1
7-digit binary numbers 1’s complement is: (27 –1) – N = 1111111 – N.
1’s complement of 1011000 is: 1111111–1011000 = 0100111.
Example: 2
6-digit decimal numbers 9’s complement is: (106 –1) – N = 999999 – N.
9’s complement of 546700 is 999999–546700 = 453299.
1’s Complement: All ‘0’s become ‘1’s and All ‘1’s become ‘0’s.
Example: 1’s Complement of (10110000)2 is (01001111)2
Radix Complement (r’s complement):
The r's complement of an n-digit number N in base r is defined as:
(r n – N) for N ≠ 0 and as 0 for N = 0
The r's complement is obtained by adding 1 to the (r - 1)'s complement.
Example: 1
The 2's complement of 1101100 is 0010100.
The 10's complement of 012398 is 987602.
2’s Complement (Radix Complement): Take 1’s complement then add 1 or Toggle all
bits to the left of the first ‘1’ from the right.
Example: Find the 2’s complement of (10110000)2.
Example:
VIII. Binary codes
Although most large computers work internally with binary numbers, the input output
equipment generally uses decimal numbers. Because most logic circuits only accept
two- valued signals, the decimal numbers must be coded in terms of binary signals.
In the simplest form of binary code, each decimal digit is replaced by its binary
equivalent.
Example: 937.25 is represented
This representation is referred to as binary-coded-decimal (BCD) or more explicitly as
8-4-2-1 BCD. Note that the result is quite different than that obtained by converting the
number as a whole into binary. Because there are only ten decimal digits, 1010 through
1111 are not valid BCD codes.
Figure 1.3 shows several possible sets of binary codes for the ten decimal digits. Many
other possibilities exist because the only requirement for a valid code is that each
decimal digit be represented by a distinct combination of binary digits. To translate a
decimal number to coded form, each decimal digit is replaced by its corresponding
code. Thus 937 expressed in excess-3 code is 1100 0110 1010. The 8-4-2-1 (BCD)
code and the 6-3-1-1 code are examples of weighted codes. A 4-bit weighted code has
the property that if the weights are w3, w2, w1, and w0, the code a3a2a1a0 represents a
decimal number N, where
N = w3 a3 + w2 a2 + w1a1 + w0 a0
The excess-3 code is obtained from the 8-4-2-1 code by adding 3 (0011) to each of
the codes. The 2-out-of-5 code has the property that exactly 2 out of the 5 bits are 1
for every valid code combination. This code has useful error-checking properties
because if any one of the bits in a code combination is changed due to a malfunction
of the logic circuitry, the number of 1 bits is no longer exactly two. The table shows one
example of a Gray code. A Gray code has the property that the codes for successive
decimal digits differ in exactly one bit. For example, the codes for 6 and 7 differ only in
the fourth bit, and the codes for 9 and 0 differ only in the first bit. A Gray code is often
used when translating an analog quantity, such as a shaft position, into digital form. In
this case, a small change in the analog quantity will change only one bit in the code,
which gives more reliable operation than if two or more bits changed at a time. The
Gray and 2-out-of-5 codes are not weighted codes. In general, the decimal value of a
coded digit cannot be computed by a simple formula when a non-weighted code is
used.
Many applications of computers require the processing of data which contains
numbers, letters, and other symbols such as punctuation marks. In order to transmit
such alpha numeric data to or from a computer or store it internally in a computer, each
symbol must be represented by a binary code. One common alphanumeric code is the
ASCII code (American Standard Code for Information Interchange). This is a 7-bit
code, so 27(128) different code combinations are available to represent letters,
numbers, and other symbols. Figure 1.4 shows a portion of the ASCII code; the code
combinations not listed are used for special control functions such as “form feed” or
“end of transmission.” The word “Start” is represented in ASCII code as follows:
1010011 1110100 1100001 1110010 1110100
Start
Fig. 1.4 ASCII Code.
IX. Binary logic
The basic operations of Boolean (switching) algebra are called AND, OR, and
complement (or inverse). In the case of switch circuits these operations correspond
to different configurations of switches. To apply switching algebra to a switch circuit,
each switch contact is labeled with a variable. If contact X is open, the variable X is
defined to be 0; if contact X is closed, the variable X is defined to be 1.
The contacts in a switch can be normally open (NO) or normally closed (NC). When
the switch position is changed, the NO contact closes and the NC contact opens,
so the NO and NC contacts are always in opposite states. If X is the variable
assigned to the NO contact, then the variable assigned to the NC contact is the
complement of X, denoted as X′, where the prime (′) denotes complementation.
where the circle at the output indicates inversion. A low voltage at the inverter input
produces a high voltage at the output and vice versa.
In a general switch circuit, the value 0 is assigned to the connection between two
terminals in the circuit if there is no connection (open circuit) between the terminals,
and a 1 is assigned if there is a connection (closed circuit) between the terminals.
If the switch circuit only contains two switches, the switch contacts must be
connected in series or in parallel. When switch contacts A and B are connected in
series, there is an open circuit between the terminals if either A or B or both are
open (0), and there is a closed circuit between the terminals only if both A and B
are closed (1).
This is summarized in the following truth table:
The operation defined by the table is called AND and it is written algebraically as C
= A · B. The “·” symbol is frequently omitted in a Boolean expression, and we will
usually write AB instead of A · B. The AND operation is also referred to as logical
(or Boolean) multiplication.
When switches A and B are connected in parallel, there is a closed circuit between
the terminals if either A or B is closed (1), and there is an open circuit between the
terminals only if both A and B are open (0).