0% found this document useful (0 votes)
12 views

Notes 1

Uploaded by

Jason Galit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Notes 1

Uploaded by

Jason Galit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1 Basic Digital Concepts

By converting continuous analog signals into a finite number of discrete states, a process
called digitization, then to the extent that the states are sufficiently well separated so that
noise does create errors, the resulting digital signals allow the following (slightly idealized):

• storage over arbitrary periods of time

• flawless retrieval and reproduction of the stored information

• flawless transmission of the information

Some information is intrinsically digital, so it is natural to process and manipulate it


using purely digital techniques. Examples are numbers and words.
The drawback to digitization is that a single analog signal (e.g. a voltage which is a
function of time, like a stereo signal) needs many discrete states, or bits, in order to give
a satisfactory reproduction. For example, it requires a minimum of 10 bits to determine a
voltage at any given time to an accuracy of ≈ 0.1%. For transmission, one now requires 10
lines instead of the one original analog line.
The explosion in digital techniques and technology has been made possible by the incred-
ible increase in the density of digital circuitry, its robust performance, its relatively low cost,
and its speed. The requirement of using many bits in reproduction is no longer an issue:
The more the better.
This circuitry is based upon the transistor, which can be operated as a switch with
two states. Hence, the digital information is intrinsically binary. So in practice, the terms
digital and binary are used interchangeably. In the following sections we summarize some
conventions for defining the binary states and for doing binary arithmetic.

1.1 Binary Logic States


The following table attempts to make correspondences between conventions for defining
binary logic states. In the case of the TTL logic gates we will be using in the lab, the Low
voltage state is roughly 0–1 Volt and the High state is roughly 2.5–5 Volts. See page 475 of
the text for the exact conventions for TTL as well as other hardware gate technologies.

Boolean Logic Boolean Algebra Voltage State Voltage State


(positive true) (negative true )
True (T) 1 High (H) Low (L)
False (F) 0 L H

The convention for naming these states is illustrated in Fig. 1. The “positive true” case
is illustrated. The relationship between the logic state and label (in this case “switch open”)
at some point in the circuit can be summarized with the following:
The labelled voltage is High (Low) when the label’s stated function is True (False).
In the figure, the stated function is certainly true (switch open), and this does correspond to
a high voltage at the labelled point. (Recall that with the switch open, Ohm’s Law implies
that with zero current, the voltage difference across the “pull up” resistor is zero, so that

1
the labelled point is at +5 Volts. With a closed switch, the labelled point is connected to
ground, with a 5 Volt drop across the resistor and a current of I = V /R = 5 mA through
it.)

+5 V

1k
switch open

Figure 1: Illustration for labelling logic states (“positive true”).

With the convention known as “negative true”, the label would be changed to “switch
closed” with a bar over it: switch closed. Our statement becomes:
The labelled voltage is Low (High) when the label’s stated function is True (False).
So in the figure, the stated function (switch closed) is true when the voltage is low. The bar
is meant to envoke the boolean inversion operation: T̄ = F, F̄ = T, T̄¯ = T, and so forth.

1.2 Binary Arithmetic


Each digit in binary is a 0 or a 1 and is called a bit, which is an abbreviation of binary digit.
There are several common conventions for representation of numbers in binary.
The most familiar is unsigned binary. An example of a 8-bit number in this case is
010011112 = 0 × 27 + 1 × 26 + · · · + 1 × 20 = 64 + 8 + 4 + 2 + 1 = 7910
(Generally the subscripts will be omitted, since it will be clear from the context.) To convert
from base 10 to binary, one can use a decomposition like above, or use the following algorithm
illustrated by 79: 79/2 = 39, remainder 1, then 39/2 = 19 r 1, and so forth. Then assemble
all the remainders in reverse order.
The largest number which can be represented by n bits is 2n − 1. For example, with 4
bits the largest number is 11112 = 15.
The most significant bit (MSB) is the bit representing the highest power of 2, and the
LSB represents the lowest power of 2.
Arithmetic with unsigned binary is analogous to decimal. For example 1-bit addition
and multiplication are as follows: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 0, 0 × 0 = 0, 0 × 1 = 0, and
1 × 1 = 1. Note that this is different from Boolean algebra, as we shall see shortly, where
1 + 1 = 1.
Another convention is called BCD (“binary coded decmal”). In this case each decimal
digit is separately converted to binary. Therefore, since 7 = 01112 and 9 = 10012, then
79 = 01111001 (BCD). Note that this is different than our previous result. We will use
BCD quite often in this course. It is quite convenient, for example, when decimal numerical
displays are used.

2
Yet another convention is Gray code. You have a homework problem to practice this.
This is less commonly used.

1.2.1 Representation of Negative Numbers


There are two commonly used conventions for representing negative numbers.
With sign magnitude, the MSB is used to flag a negative number. So for example with
4-bit numbers we would have 0011 = 3 and 1011 = −3. This is simple to see, but is not
good for doing arithmetic.
With 2’s complement, negative numbers are designed so that the sum of a number and
its 2’s complement is zero. Using the 4-bit example again, we have 0101 = 5 and its 2’s
complement −5 = 1011. Adding (remember to carry) gives 10000 = 0. (The 5th bit doesn’t
count!) Both addition and multiplication work as you would expect using 2’s complement.
There are two methods for forming the 2’s complement:

1. Make the transformation 0 → 1 and 1 → 0, then add 1.

2. Add some number to −2MSB to get the number you want. For 4-bit numbers an
example of finding the 2’s complement of 5 is −5 = −8 + 3 = 1000 + 0011 = 1011.

1.2.2 Hexadecimal Representation


It is very often quite useful to represent blocks of 4 bits by a single digit. Thus in base
16 there is a convention for using one digit for the numbers 0,1,2,. . .,15 which is called
hexadecimal. It follows decimal for 0–9, then uses letters A–F.

Decimal Binary Hex


0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F

You might also like