Download ebooks file Digital Logic for Computing 1st Edition John Seiffertt (Auth.) all chapters
Download ebooks file Digital Logic for Computing 1st Edition John Seiffertt (Auth.) all chapters
com
https://textbookfull.com/product/digital-logic-for-
computing-1st-edition-john-seiffertt-auth/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/sets-logic-and-maths-for-
computing-3rd-edition-makinson-d/
textboxfull.com
https://textbookfull.com/product/logic-and-algebraic-structures-in-
quantum-computing-1st-edition-jennifer-chubb/
textboxfull.com
https://textbookfull.com/product/evolution-the-logic-of-biology-1st-
edition-john-s-torday/
textboxfull.com
https://textbookfull.com/product/evolution-the-logic-of-biology-1st-
edition-john-s-torday-2/
textboxfull.com
Philosophical Logic: A Contemporary Introduction John
Macfarlane
https://textbookfull.com/product/philosophical-logic-a-contemporary-
introduction-john-macfarlane/
textboxfull.com
https://textbookfull.com/product/lighting-for-digital-video-and-
television-fourth-edition-john-jackman/
textboxfull.com
https://textbookfull.com/product/big-data-analytics-and-computing-for-
digital-forensic-investigations-1st-edition-suneeta-satpathy-editor/
textboxfull.com
https://textbookfull.com/product/the-logic-of-charity-great-
expectations-in-hard-times-1st-edition-john-mohan/
textboxfull.com
https://textbookfull.com/product/soft-computing-evaluation-logic-the-
lsp-decision-method-and-its-applications-dujmovic/
textboxfull.com
John Seiffertt
Digital Logic
for Computing
Digital Logic for Computing
John Seiffertt
v
vi Preface
Chapter 14—Counters
The state machine design process, core to the use of sequential networks, is
introduced in this chapter in the context of building counters. Many kinds of
counters are presented and their use in datapath design and signal generation is
discussed. As counters are of critical importance in digital design, and the state
machine design process is good to learn in its simplified form presented here first,
this is a highly recommended chapter.
Chapter 15—Datapaths
This is an important design chapter. The study of datapaths brings together all
the components from previous chapters and ties them into the algorithm concepts at
the core of the text. A successful study of this chapter will help the reader to learn to
take specifications, optimally lay out the design using digital elements, and mini-
mize the required signals for maximum efficiency.
Chapter 16—Basic Computer Datapath
A combination of sorts of Chaps. 9 and 15, in this chapter we discuss how to
construct a datapath of particular importance: that of an actual digital electronic
computer. Of definite interest to computer scientists and computer engineers, even
electrical engineers may enjoy seeing this key specialized application of digital
circuitry.
Chapter 17—State Machines
This is one of the most important chapters. No study of digital design is complete
without full coverage of the design and application of state machines. We begin
with a generalized state machine partitioned into next state logic, output logic, and
state memory. This chapter then develops state diagram, state tables, and
implementations using various flip-flops. Mealy and Moore machines are covered.
Chapter 18—Datapath Controllers
Extending the initial discussion of state machines from Chap. 17, this chapter
looks at their use specifically in conjunction with the datapaths covered in Chap. 15.
Partitioning large digital systems into state machine controller and datapath sec-
tions is common, and through detailed examples this chapter walks through the
lengthy design process. The climax of the text in a way, the design of datapath
controllers brings together everything previously studied. The student who success-
fully works through this chapter has obtained a strong intro-level knowledge of
digital design and is well-positioned for more advanced study in the field.
Chapter 19—State Machine Theory and Optimization
State reduction and assignment are covered in this chapter, and those are
reasonably standard in texts of this kind. This chapter begins, however, with a
discussion of formal languages and automata. These are topics typically reserved
for computer science theory courses, and they are included here to emphasize the
text’s unique focus on computing. The relationship between theoretical models of
computation and their applied counterparts the student has been construction in
previous chapters is made clear. Not intended even as a primer in automata theory,
Preface ix
the goal here is to give just a brief morsel to entice further thinking on the matter.
Too often, the science and engineering sides of the field are kept very far apart from
one another, and this chapter, by drawing parallels between them based on material
relevant to both and covered previously in the text, is an attempt to bridge this gap.
It is certainly not going to serve as a compete study of these topics, but the hope is
that some philosophically inclined readers may see these ideas here for the first time
and be motivated to explore them further.
Chapter 20—Instruction Processor Design
The text ends with a full-design case study of an electronic digital computer. We
take a pedagogical approach here in repeating some concepts from earlier chapters,
intentionally using slightly different language and notation, so the student can see
them really coming together in a solid whole. The idea is that if you try to read this
chapter first, it should feel overwhelming. But, if read after careful study of the rest
of the text, the successful student should be nodding along and say “Yes, I have
this!” as the actual computer is designed from the instruction set on up. The
exercises continue the design process and, if completed, the reader will have
finished the study of digital logic for computing by actually sketching the details
of a functional instruction processor. We feel this chapter is a unique feature of this
text and encourage students to take advantage of it.
Acknowledgments
This work is the result of more than 5 years of teaching digital logic at the Missouri
University of Science and Technology. I thank most of all the fine students of that
great institution whose questions, comments, and feedback shaped my course and
formed the bulk of this text. I am also grateful for the support provided by my
colleagues, in particular Joe Stanley and Donald Wunsch, who taught alongside me
and motivated me to increase my teaching ability both in the classroom and in the
preparation of this manuscript. Many excellent problem types and modes of expla-
nation found in this text are due to their insights. I also want to thank my current
department at Truman State University for their encouragement as I completed
this text.
xi
Contents
xiii
xiv Contents
6 Logic Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Programmable Logic Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
XOR, NAND, and NOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Bitwise Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
CMOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Electronic Properties of Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7 Unsigned Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Unsigned Binary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Full Adder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
High-Speed Adders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Fractions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Hexadecimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
8 Signed Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Sign-Magnitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Two’s Complement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Building an Adder/Subtractor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Sign Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Signed Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Ten’s Complement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
9 Other Digital Representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Binary Coded Decimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Decimal Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Gray Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Alphanumeric Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Fixed Point Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Floating-Point Representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Designing an Encoding: Days of the Year . . . . . . . . . . . . . . . . . . . . . 131
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
10 Encoding Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Instructions and Datapaths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Variables and Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Conditionals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Digital Representation of Instructions . . . . . . . . . . . . . . . . . . . . . . . . 143
Hex Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Contents xv
Status signals
Control Datapath
Unit
Control signals
Digital
We can physically compute with analog values in a number of ways. We can pour
water from two buckets into a third: the water now present represents the sum of the
previous two values. We can attach two wires together and see the total voltage
being the sum of the voltages of each. While it may seem ideal to compute in this
fashion because we can represent any number and perform calculations to arbitrary
precisions, what happens in practice is that we lose tiny bits here and there. A few
drops of water fall from a bucket and the wire degrades a bit of the voltage.
Digital 3
Low
0
D1 D2
All together, this interference, this noise, makes precise computation difficult. It is
for this reason that we consider digital systems in this book.
The word digital derives from the Latin digitum, which means finger. It was
originally used to mean ten: this is why we have digits in our base-10 number
system. In fact, early precursors to modern computers such as Charles Baggage’s
Difference Engine, were digital in this sense: they operated mechanically using
base-10 numbers. We’re going to broaden the sense of the word and refer to a
digital system as one whose values are digitized, that is, whose values are broken
into discrete chunks rather than being capable of representing every possible
number.
Due to the limitations of our underlying technologies, we’re going to digitize to
the maximum extent: we will use only two values within a given range of possible
values. Consider the graph in Fig. 1.2.
We divide our infinity of values from 0 to 5 into two and we call them High and
Low. Device D1 is transmitting a signal to device D2. In order to communicate
effectively, D1 must be assured that when it sends a signal that D2 will be able to
properly interpret it as either High or Low. We see that this system has some
resistance to noise: a signal of 4.5, for example, subject to a shock of .75 might end
up transmitting as 3.75. But that is still OK because it’s in the High range and D2
still interprets it as a High signal. If we were pouring 4.5 ounces of water from one
cup to another and lost .75 ounces along the way we’d have a wildly inaccurate
sum. But in a digital system we’re fine and the computation is not affected by the
noise.
But, what if we transmit a High signal that’s less strong, say 3.0? It’s still within
the High range so our device D1 is satisfied. What if it is hit with a disruption of .75?
Now it’s transmitting a 2.25 signal which D2 interprets as being in the Low range.
We now have a breakdown in communication and our digital system won’t func-
tion. To fix this we need to force the High signals to be really high and the low
signals to be really low. We need to ensure separation between our two values.
Consider the graph shown in Fig. 1.3. Now instead of breaking the entire range
of values 0 through 5 into two categories, we have that High signals are in the range
VH to 5 and low signals in the range 0 to VL while any signal in the range VL to VH
is in the forbidden zone and is therefore not interpreted. Provided we can get VH
close to 5 and VL close to 0, we’ve done a good job here of not confusing High and
Low signals. If we have our 3.0 signal with the .75 shock, so long as 2.25 > VL we
4 1 The Digital Electronic Computer
Forbidden Zone
VL
Low
0
D1 D2
D1 D2
now can be confident that D2 will not misinterpret our noisy transmission. Instead,
D2 picks up a signal in the forbidden zone. While that’s not ideal, it’s a better case
result than D2 not even being aware a problem exists.
But, we’re not done! We can improve yet upon this configuration. We still have
an issue if we’re sending a signal that is close to VH or VL because just a small
amount of noise can disrupt it and send it into the forbidden zone. What we’d like is
for D2 to recognize signals close to these breakpoints that fall just a little bit into the
forbidden zone. This is demonstrated in Fig. 1.4.
If we make the forbidden zone smaller for the input values then the receiving
device can better understand what the transmitting device is sending even through a
bit of noise. We can now talk about VOH and VOL as the output high and low value
cutoffs and VIH and VIL as the input high and low value cutoffs. The high and low
noise margins NMH and NML can be defined:
NMH ¼ V OH V IH
NML ¼ V IL V OL
It’s not quite as simple to digitize our systems as we may think at first. Just
because the devices “are all 1’s and 0’s” doesn’t mean their internals are easy to
design. There are a lot of moving pieces here.
We speak of Logic Families as being devices that can work together. That is,
digital devices within a logic family have their high and low value cutoffs aligned
so that they are always assured accurate transmission. We can also look into
Electronic 5
intra-family communication. Consider Table 1.1 which gives the details for two
logic families, TTL and CMOS.
We can ask whether a TTL device can transmit to a CMOS device? The VOL of
TTL is .40 which is less than the VIL of CMOS at 1.15 Therefore, we have a NML
in this situation of 1.15–0.40 ¼ 0.85. Looking at the high side, however, we see that
TTL’s VOH is 2.40 while CMOS’s VIH is 3.15. This means the TTL device can
transmit any value greater than 2.40, say 2.75, while the CMOS device won’t
recognize any input less than 3.15 as a high signal. Therefore, communication
fails in this case. A TTL device cannot transmit reliably to a CMOS device.
What about the opposite case? Can a CMOS device transmit to TTL? Well, on
the Low side the CMOS device has a VOL of 0.33 which is less than TTL’s VIL of
0.80 for a NML 0f 0.800.33 ¼ 0.47 which is positive and therefore compatible.
On the High side, we have CMOS with a VOH of 3.84 and TTL with a VIH of 2.00.
This gives us a NMH of 3.842.00 ¼ 1.84 which is fine. Therefore, we can indeed
have a CMOS device transmit to a TTL device.
Be sure to carefully go through these computations so you have the idea of noise
margins, High, and Low signals clear. The entirety of digital design rests upon this
foundation, so it’s a good idea to get to where it makes sense to you.
We want our digital devices to be able to effectively communicate. That is, when
a device sends a logic-1 (high voltage) we want the receiving device to read a logic-
1 and when a device sends a logic-0 (low voltage) we want the receiving device to
read a logic-0.
To this end, devices have tolerances for the voltage levels they interpret as logic-
1 and logic-0 when both sending and receiving signals. In order to build devices that
are as resistant to noise as possible, we have different tolerances for output and
input signals. The values VOH and VOL tell us the cutoff voltages for high and low
output and the values VIH and VIL tell us the cutoff voltages for high and low inputs.
A device can drive another if its VOH is less than the VIH of the receiving device
and if its VOH is less than the VIH of the receiver.
A device can receive signals from another if its VIH is less than the VOH of the
driver and if its VIL is greater than the VOL of the driver.
If devices of two families can both drive and receive signals from each other,
then the families are said to be compatible.
Electronic
n n
SiO2
strong 0 strong 1
degraded 1 degraded 0
signal as our Low digital value and allowing it to pass as our High digital value.
In particular, the MOSFET: metal oxide semiconductor field effect transistor.
In Fig. 1.5 we see a diagram outlining its construction.
The electric signal moves from the source side out the drain side if the voltage
on the gate is high enough. Chemically, to effect this transition we use two
materials, called n and p, each doped with specific metals (n material is doped
with group II metals and p with group III metals.) We end up with two kinds of
MOSFETS, depending on where we use the n and p materials. In the diagram, we
have an nFET device. If we swap the n and p materials, we would have a pFET
device.
It turns out that nFET and pFET devices have different characteristics. Transis-
tors in the nFET category transmit a Low signal very well but have a hard time
passing a High signal. They end up pulling the High voltage lower, and sometimes
this is more noise than the device can handle and we end up in the forbidden zone.
The pFET devices are the opposite: they are just fine for passing High voltage
signals but pull Low voltages up and make them harder to read.
In technical language, we say the nFET passes a degraded 1 and a strong
0 while the pFET passes a degraded 0 and a strong 1. (In later chapter’s we’ll call
the High voltage a logic-1 and the Low voltage a logic-0.)
The diagram in Fig. 1.6 shows the circuit symbol we use for nFETs and pFETS
as well as summarizes the characteristics relevant for our digital design needs.
In Chap. 6, we’ll get into great detail about how we use these transistors to build
the components necessary to implementing algorithms with our digital logic
Computer 7
elements. For this introductory chapter, it’s sufficient to leave off here with the idea
of underlying technology merely described at a low level.
Computer
In this book we will study the design, operation, and capabilities of the digital
electronic computer, the most widely used commercial embodiment of the idea of
an instruction processor.
But what do we mean by the word computer? Students on the first day of class
often respond to the question “What is a computer?” with a variation on “something
that computes!” The natural follow-up is then “ok, so what is a computation?” That
one is harder to answer. It’s common for non-CS people to think of computation as
“coming up with fancy ways to calculate the square root of a number” and other
related numerical investigations. And while we certainly want to include the
exploration of number within our understanding of computation, we don’t want to
commit to that being the end of the story. Because, more generally, and as stated in
the beginnings of the field of computing science by Alan Turing and other pioneers,
when we think of computations in a true computer science sense we mean not the
processing of numbers only but the processing of language taken more generally.
That’s right! Computations are considered the processing of language! And, this
dovetails nicely with the approach taken in looking at digital logic from the vantage
point of algorithms broadly understood. Because, at the end of the day, some of the
most important things we can say about algorithms involve their expressibilty as
language. The code we write to configure instruction processors to do great things
is, after all, language, and we consider the computer itself as a digital electronic
circuit that responds to this language.
So, the language, more specifically the idea of programmability which involves
the processing of not just one sequence from a language but rather the ability to
handle any expression of a particular language, is central to our understanding of
what a computer is. While we may take ancient devices such as the astrolabe or
abacus as computer in the sense that they do indeed take inputs and produce outputs
based on some internal mechanized computation, they are not programmable so
they do not qualify as a computer.
We can go a step further and look at digital electronic circuits, such as those in a
simple hand calculator, that may excel at computations and, as we’ll study as we
proceed in this text, are indeed the implementation of algorithms expressed in
language. But, these are also not computers because they are not programmable!
You cannot change what they do by writing a new algorithm. These are called
application specific integrated circuits (ASICS) and are the focus of electrical
engineers when they study digital design principles. We’ll certainly talk about
them, and Chap. 18 in particular develops these in great detail, but the text caps
with a chapter on the design of an instruction processor and throughout we are
concerned with the relationship between digital logic and programmability.
8 1 The Digital Electronic Computer
Exercises
Answer each of the following questions YES or NO and, if NO, give a reason.
(a) Can a TTL device drive a CMOS device?
(b) Can a TTL device drive a LVTTL device?
(c) Can a TTL device drive a LVCMOS device?
(d) Can a CMOS device drive a TTL device?
(e) Can a CMOS device drive a LVTTL device?
(f) Can a CMOS device drive a LVCMOS device?
(g) Can a LVTTL device drive a TTL device?
(h) Can a LVTTL device drive a CMOS device?
(i) Can a LVTTL device drive a LVCMOS device?
(j) Can a LVCMOS device drive a TTL device?
(k) Can a LVCMOS device drive a CMOS device?
(l) Can a LVCMOS device drive a LVTTL device?
(m) What does “LV” stand for in the LVTTL and LVCMOS families?
(a) Can a device from family A drive a device from family B? Why or why
not?
(b) Can a device from family B drive a device from family A? Why or why
not?
1.6 Suppose a logic family has a high noise margin of NMH ¼ .3. If VIH ¼ 4.5, what
must VOH be?
1.7 There are many ways to design a device which will sequentially execute
instructions. The mathematician John von Neumann was a pioneer in the
development of digital electronic computers, consulting on the construction
of a computer called the EDVAC in the 1940’s. His early writings on computer
design and organization are still relevant today, as most computers are built
using the basic principles he laid out. Research the concept of von Neumann
architecture and write a few sentences about its features.
1.8 Is a sun dial a computer? It takes an input, sunlight, and computes an output,
time of day? So, is it a computer? This is a bit of a jokey question, but also
highlights the importance of the key elements we want in our definition of a
computer. We’re not particularly interested in exploring what a pole stuck in
the ground can do.
Chapter 2
Boolean Algebra
We need a language to discuss the design of the computer. Once upon a time,
humans looked to the stars and developed what we know as Calculus to describe
their motion. It turned out that algebra and calculus based on the real numbers work
quite well to describe systems involving energy, motion, time, and space. The real
numbers are a useful model for those quantities. Within our digital computer,
however, we only have access to two values, logic-1 and logic-0. We don’t have
an infinity of values over which our functions may vary. Therefore, the early
pioneers of computing found themselves faced with a dilemma. They could not
use the classical mathematics they knew and loved; rather, they faced the task of
developing a new mathematics capable of working with only two values.
These engineers were not amused. Developing new mathematics is for mathe-
maticians, they reasoned. So, they did the next best thing. They looked around at
what the mathematicians were doing and instead of crafting a new computer design
mathematics from scratch they happened upon something close to what they
wanted, and they stole it. (OK, they repurposed it.)
It turned out that a nineteenth century schoolteacher and philosopher named
George Boole had worked out a mathematics for how people (or at least how
mathematicians) reasoned through formal problems. Instead of representing quan-
tities such as velocity and mass and curvature, the variables in Boole’s mathematics
represented English statements. Instead of addition, subtraction, and multiplication,
Boole’s mathematics combined variables in the logical operations of and, or, and
not. So far, this isn’t really what the computer engineers were looking for, but the
last key piece of what Boole had developed sealed the deal: all the variables took on
only one of two values! That was it! The engineers needed a two-valued mathe-
matics, and Boole had one. Sure, Boole called the values True and False and the
engineers wanted to call them logic-1 and logic-0, but it was close enough (engi-
neers are all about “close enough”.)
So, here we are: Boolean Algebra is the name given to the mathematics that is
used to describe the behavior of all digital systems, computers included. Let’s check
it out.
To get a sense of how Boolean Algebra differs from the algebra and calculus you’re
already familiar with, let’s consider an example. Suppose we have a cabin by a river
and staff it with a robotic sentry to keep out bears and ewoks. The house is equipped
with window, door, and chimney sensors which detect intrusion as well as an
infrared sensor which can determine size, and the sentry can sound a local alarm
or take action against the intruder.
The schematic of the setup can be seen in Fig. 2.1.
We call the door sensor D, the chimney sensor C, the window sensors w0, w1, w2,
and w3 (in the diagram w3 is overlooking the river), and the infrared sensor we’ll
call R. Let’s give names to the sentry’s actions, too: A will be sound the alarm and E
will be to engage the intruder.
Now, let’s see how Boolean Algebra can help us specify how this system works.
First, we would like the sentry to sound an alarm if any of the door or window
sensors activate. We can write this as an equation:
A ¼ D or w0 or w1 or w2 or w3
W0 W1
W2
Fig. 2.1 Boolean Algebra Schematic: D is the door sensor, W0, W1, W2 are the window sensors,
R is the infrared sensor, and C is the chimney sensor
Digital Logic Design Process 13
Algebra digital designers use, we represent the logical or operation with a plus sign, +,
and our equation becomes
A ¼ D þ w0 þ w1 þ w2 þ w3
Now we’re getting somewhere! We have an equation where the variables can
take on two values, logic-1 and logic-0, that implements the behavior we’ve
specified. But, we start to wonder, what does it mean to add these strange logic-1
and logic-0 values? I know what 15 + 6 means, but what does logic-1 + logic-
0 mean? To answer that question we have to specify how our OR operation works.
In real-valued algebra and calculus we often graph functions. For example, y ¼ x2
gives us the familiar parabola (Fig. 2.2).
The arrows on the axes and the ends of the parabola indicate these quantities
extend forever, as the real numbers are infinite. We also know the solid lines of the
shape indicate an infinitely dense system of numbers, as no matter how deep we
delve, between 2 and 3, or between 2.5 and 2.6, or between 2.55 and 2.56, there is
always another number to be found.
In our two-valued system, this is not the case. We don’t need to specify how our
operators work using a graph as we do on the real line. Instead, we use a table that
enumerates all possible combinations of inputs, because (at least for small numbers
of input variables) this is quite feasible.
So, here’s the table that tells us how our OR operation works:
On the left we have all four combinations of our two input variables and on the
right we say what the OR operation returns for each combination. Taken as normal
math, the first four make a lot of sense, as there is nothing objectionable to noting
that 0 + 0 ¼ 0, 0 + 1 ¼ 1, or 1 + 0 ¼ 1. However, the last line, claiming 1 + 1 ¼ 1,
gives us pause. It’s clear now we are not working with real numbers. We are in
another world, that of Boolean Algebra. We must remember that the 1’s and 0’s are
not the same 1’s and 0’s that we find on the real number line and the + is not the
same addition we apply to real numbers. Only the equal sign is the same! For us,
1 + 1 ¼ 1 is natural and explains how we want our digital system to work: we want
the entire expression to evaluate to logic-1 as long as any one of the inputs is logic-
1. Going back to our example, we see that we want the alarm to sound, that is, we
want A to be 1, when any of the sensors is 1, so it would be counterproductive to
declare that 1 + 1 ¼ 0 (which is the only other possibility since we don’t have the
symbol 2 available to us) because that would mean that intruders could break in if
only they attack two locations simultaneously. That’s not the behavior we’re
looking for here.
14 2 Boolean Algebra
Table 2.1 is called a truth table and the values of the function are called truth
values. These terms are artifacts from the original application of Boolean Algebra
to matters of propositions, arguments, and the truth of statements. It’s incredibly
important that we realize that while we are using the same underlying mathematics,
our interpretations of the two values in the system are fundamentally different from
traditional Boolean Algebra. For us, the terms True and False have no meaning.
We say “one” and “zero” instead, and, while there is some obvious connection
symbolically between our logic-1 and True and between our logic-0 and False,
carrying that connection too far can impede our ability to design systems effec-
tively. We may think that logic-1, or True, means that a particular device is “on” or
“active” and a logic-0, or False, means the device is “off” or “inactive.” Nothing
could be farther from the truth!
We’ve skipped over this detail so far, but it’s actually crucial to decide what logic-
1 and logic-0 represent in a system. If we say that the variable D ¼ 1 when the door
sensor detects movement and D ¼ 0 when the door sensor does not detect movement,
then we are saying the sensor is active high, that is, that the logic-1 corresponds to the
device being on, or active. However, this doesn’t have to be the case (and, depending
on how the electronics are designed, is often not the case.) We could specify D ¼ 1
when the door sensor does not detect movement and D ¼ 0 when the sensor detects
movement. Then D would be active low, that is, the logic-1 value would be
associated with an inactive device and the logic-0 value with an active device
(Table 2.2). If we think in terms of True and False these electronic realities can be
hard to grasp. It’s much better to think in terms of abstract 1’s and 0’s whose
meanings are determined by the behavior of a given real physical system.
Let’s look back at our example. We’ve assumed the signals A, D, w0, w1, w2,
and w3 are all active-high. What happens if, say, the window sensors become
active-low? Now we want the equation for A to evaluate to a 1 when we get a 1 on D
or a 0 on any of the wi’s. To account for this, we need to introduce a new logic
operator: not.
Table 2.3 shows the truth table for not.
Once you grasp it, this is all pretty straightforward and simple, yet it remains
incredibly useful. We can now keep the basic form of our logic equation for the
alarm A and just replace the active-low signals with their complements (the not of a
variable is called its complement.)
A ¼ D þ x0 þ x1 þ x2 þ x3
If A were active-low, we’d need to complement the entire equation and end up
with
A ¼ D þ x0 þ x1 þ x2 þ x3
The idea is that the sentry will sound the alarm to scare off weak or small
intruders. What if we have a large bear smashing through the window? In this case
we don’t want to sound an alarm which may only serve to further enrage the beast.
So we want our (active-high) Alarm not to sound when the infrared sensor detects a
large creature. Let’s say that happens when R ¼ 1. So, in words we want A to be
1 when the door sensor is active or when any window sensors are active and when
the infrared sensor is inactive.
We have a new logic word: and. Our equation becomes
A ¼ ðD þ x0 þ x1 þ x2 þ x3 Þ and R
While the logicians would use л for and (and call it conjunction to boot), we’re
not going to adopt all their practices and we’ll go ahead and use our familiar
multiplication symbols for the logical and operation:
A ¼ ðD þ x0 þ x1 þ x2 þ x3 ÞR
The truth table for and shows us that this operation is only logic-1 when all its
inputs are logic-1 can be seen in Table 2.4.
The multiplication makes sense here as we know anything times zero is zero. It’s
intuitive and works, so we’ll go with it.
What about the chimney sensor? The idea here is that any intruder bold enough
to enter through the chimney needs to be met head on by the sentry, same as any
intruder sized too large. Let’s make the chimney sensor active-low so that C ¼ 1
when no intruder is detected and C ¼ 0 when one is scurrying down the smokestack.
Our alarm equation is then
A ¼ ðD þ x0 þ x1 þ x2 þ x3 ÞRC
Read over this logic and make sure you follow why we have a C at the far right.
It’s easy to get mixed up when dealing with nots and active-low logic.
Let’s write the equation now for the sentry’s engage logic. We want it to engage
when the intruder is large or activity is detected on the chimney sensor (that means
R ¼ 1 and C ¼ 0).
E ¼ RC
We could add a timer T to the system that measures how long the alarm rings. If
the alarm rings long enough to exceed a threshold (T ¼ 1) then the alarm should
shut off and the sentry ought to engage the intruder because the alarm clearly isn’t
working to scare it away. Then our final equations become
T
A ¼ ðD þ x0 þ x1 þ x2 þ x3 ÞRC
E ¼ RC þ T
Make sure you see where these equations come from and you’ll be on your way
to writing logic equations to describe the behavior of digital systems.
What we’ve covered so far are the basic elements of logic operations that we’ll need
to use the rest of the book in designing of our digital systems. There is a lot more to
Boolean Algebra and the mathematical approach to logic than we will actually
require problem-to-problem as digital designers. This section delves deeper in the
mathematical structure underlying Boolean Algebra and illustrates some more
ways to conceive of and to work with the symbols we generate to describe our
systems in terms of AND, OR, and NOT.
Mathematics is about getting to the essence of certain kinds of things and then
drawing connections among these essences. Where laymen see a 5 and a plus sign +
and a 7 and think “Yes, 5 apples and 7 apples makes a dozen, thank you very much,”
mathematicians ask things like “what, really, are 5 and 7,” what is “addition,” and
“what fun is there to be had if we can tinker with each of these?”
The normal answer is that 5 and 7 are real numbers and addition + is an
operation on these real numbers. But what if 5 and 7 were instead members of
the set {1,2,3,4,5,6,7,8) and addition were now an operation on this set of integers?
We’d have to define 5 + 7 in another way. Maybe we’d just wrap around so that
5 + 7 ¼ 4. We can call this modular arithmetic and run with it a great distance,
tinkering this way and that as our system gets more and more interesting.
Algebra’s essence, then, is that we have some variables which take on values
from a set (or sets), we have operations that follow certain rules, and we have some
Exploring the Variety of Random
Documents with Different Content
Let thy holy Spirit, who on the first day of the week descended in
miraculous gifts on thy apostles, descend on me thy unworthy
servant, that I may be always in the spirit on the Lord’s day. Let his
blessed inspiration prevent and assist me in all the duties of this thy
sacred day, that my wandring thoughts may all be fixed on thee, my
tumultuous affections composed, and my flat and cold desires
quickned into fervent longings and thirstings after thee. O let me
join in the prayers and praises of thy church with ardent and
heavenly affection, hear thy word with earnest attention and a fixed
resolution to obey it. And when I approach thy altar, pour into my
heart humility, faith, hope, love, and all those holy dispositions,
which become the solemn remembrance of a crucified Saviour. Let
me employ this whole day to the ends for which it was ordained, in
works of necessity and mercy, in prayer, praise, and meditation; and
let the words of my mouth, and the meditation of my heart be
always acceptable in thy sight.
I know thou hast created me, and that I have neither being nor
blessing but what is the effect of thy power and goodness.
I know thou art the end for which I was created, and that I can
expect no happiness but in thee.
I know that in love to me, being lost in sin, thou didst send thy
only Son, and that he being the Lord of glory, did humble himself to
the death upon the cross, that I might be raised to glory.
S U N D A Y E V E N I N G.
1. Have I set apart some of this day, to think upon his perfections
and mercies?
Bless my father, &c. my friends and relations, and all that belong
to this family; all that have been instrumental to my good, by their
assistance, advice, example, or writing, and all that do not pray for
themselves.
M O N D A Y M O R N I N G.
O GOD, who art the giver of all good gifts, I thy unworthy servant,
entirely desire to praise thy name for all the expressions of
thy bounty towards me. Blessed be thy love for giving thy Son to die
for our sins, for the means of grace, and for the hope of glory.
Blessed be thy love for all the temporal benefits which thou hast
with a liberal hand poured out upon me; for my health and strength,
food and raiment, and all other necessaries with which thou hast
provided thy sinful servant. I also bless thee that, after all my
refusals of thy grace, thou still hast patience with me, hast
preserved me this night, (――) ¹ and given me yet another day, to
renew and perfect my repentance. Pardon, good Lord, all my former
sins, and make me every day more zealous and diligent to improve
every opportunity of building up my soul in thy faith, and love, and
obedience: make thyself always present to my mind, and let thy love
fill and rule my soul, in all those places, and companies, and
employments, to which thou callest me this day. In all my passage
through this world, suffer not my heart to be set upon it: but always
fix my single eye, and my undivided affections on the prize of my
high calling! This one thing let me do; let me so press toward this,
as to make all things else minister unto it; and be careful so to use
them, as thereby to fit my soul for that pure bliss, which thou hast
prepared for those that love thee!
M O N D A Y E V E N I N G.
5. Have I let him, I thought in the wrong (in a ♦trifle) have the
last word?
Adored be thy goodness for all the benefits thou hast already
from time to time bestowed on me: for the good things of this life,
and the hope of eternal happiness. Particularly, I offer to thee my
humblest thanks for thy preservation of me this day, (――) ¹. If I
have escaped any sin, it is the effect of thy restraining grace: if I
have avoided any danger, it was thy hand directed me. To thy holy
name be ascribed the honour and glory. O let the sense of all thy
blessings have this effect upon me, to make me daily more diligent
in devoting myself, all I am, and all I have to thy glory.
T U E S D A Y M O R N I N G.
O ETERNAL and merciful Father, I give thee humble thanks
(increase my thankfulness, I beseech thee) for all the
blessings, spiritual and temporal, which in the riches of thy mercy
thou hast poured down upon me. Lord, let me not live but to love
thee, and to glorify thy name. Particularly I give thee most unfeigned
thanks for preserving me from my birth to this moment and for
bringing me safe to the beginning of this day (――) ¹ in which, and
in all the days of my life, I beseech thee that all my thoughts, words,
and works may tend to thy glory. Heal O Father of mercies, all my
infirmities (――), strengthen me against all my follies; forgive me all
my sins (――), and let them not cry louder in thine ears for
vengeance, than my prayers for mercy and forgiveness.
O Lord, hear the king in the day of his trouble; let thy name, O
God, defend him. Grant him his heart’s desire, and fulfil all his mind.
Set his heart firm upon thee, and upon other things only as they are
in and for thee. O defend him and his royal relations from thy holy
heaven, even with the saving strength of thy right-hand.
Have mercy upon this kingdom, and forgive the sins of this
people: turn thee unto us, bless us, and cause thy face to shine on
our desolations. Inspire the nobles and magistrates with prudent
zeal, the gentry and commons, with humble loyalty. Pour down thy
blessings on all seminaries of true religion and learning, that they
may remember and answer the end of their institution. Comfort all
the sons and daughters of affliction, especially those who suffer for
righteousness sake. Bless my father and mother, my brethren and
sisters, my friends and relations, and all that belong to this family.
Forgive all who are mine enemies, and so reconcile them to me and
thyself, that we all, together with those that now sleep in thee, may
awake to life everlasting, through thy merits and intercession, O
blessed Jesus; to whom with the Father and the Holy Ghost, be
ascribed by all creatures, all honour, and might, and wisdom, and
glory, and blessing.
T U E S D A Y E V E N I N G.
3. Have I ascribed to myself any part of any good which God did
by my hand?
11. Have I omitted justifying myself where the glory of God was
not concerned? Have I submitted to be thought in the wrong?
¹ Ignatius.
O pour upon our whole church, and especially upon the clergy
thereof, the continual dew of thy blessing. Grant to our universities
peace and piety, and to all that labour under affliction, constant
patience and timely deliverance. Bless all my kindred, (especially my
father and mother, my brothers and sisters) and all my friends and
benefactors (――) ¹. Turn the hearts of my enemies (――); forgive
them and me all our sins, and grant that we and all the members of
thy holy church, may find mercy in the dreadful day of judgment,
through the mediation and satisfaction of thy blessed Son Jesus
Christ, to whom with thee and the Holy Ghost the comforter, be all
honour, praise and thanksgiving, in all the churches of the saints for
ever.
W E D N E S D A Y M O R N I N G.
O THOU who dwellest in the light which no man can approach, in
whose presence there is no night, in the light of whose
countenance there is perpetual day: I thy sinful servant, whom thou
hast preserved this night, who live by thy power this day, bless and
glorify thee, for the defence of thy almighty providence, (――) ¹ and
humbly pray thee, that this, and all my days may be wholly devoted
to thy service. Send thy Holy Spirit to be the guide of all my ways,
and the sanctifier of my soul and body. Save, defend, and build me
up in thy fear and love; give unto me the light of thy countenance,
peace from heaven, and the salvation of my soul in the day of the
Lord Jesus.
O Thou who art the way, the truth, and the life, thou hast said no
man can follow thee, unless he renounce himself. I know, O Saviour,
that thou hast laid nothing upon us but what the design of thy love
made necessary for us. Thou sawest our disease, our idolatrous self-
love, whereby we fell away from God, to be as gods ourselves, to
please ourselves, and to do our own will. Lo, I come! May I ever
renounce my own, and do thy blessed will in all things!
I know, O God, thou didst empty thyself of thy eternal glory, and
tookest upon thee the form of a servant. Thou who madest all men
to serve and please thee, didst not please thyself, but wast the
servant of all. Thou O Lord of the hosts of heaven and earth, didst
yield thy cheeks to be smitten, thy back to be scourged, and thy
hands and feet to be nailed to an accursed tree. Thus didst thou, our
great Master, renounce thyself: And can we think much of
renouncing our vile selves? My Lord and my God, let me not
presume to be above my master! Let it be the one desire of my
heart, to be as my master, to do not my own will, but the will of him
that sent me.
O thou whose whole life did cry aloud, Father, not mine, but thy
will be done, give me grace to walk after thy pattern, to tread in thy
steps. Give me grace to take up my cross daily, to inure myself to
bear hardship. Let me exercise myself unto godliness betimes,
before the rains descend and the floods beat upon me: Let me now
practise what is not pleasing to flesh and blood, what is not
agreeable to my senses, appetites, and passions, that I may not
hereafter renounce thee, for fear of suffering for thee, but may
stand firm in the day of my visitation.
*O thou, who didst not please thyself, altho’ for thy pleasure all
things are and were created, let some portion of thy spirit descend
on me, that I may deny myself and follow thee. Strengthen my soul
that I may be temperate in all things; that I may never use any of
thy creatures but in order to some end thou commandest me to
pursue, and in that measure and manner which most conduces to it.
Let me never gratify any desire, which has not thee for its ultimate
object. Let me ever abstain from all pleasures, which do not prepare
me for taking pleasure in thee, as knowing that all such war against
the soul, and tend to alienate it from thee. O save me from ever
indulging either the desire of the flesh, the desire of the eye, or the
pride of life. Set a watch, O Lord, over my senses and appetites, my
passions and understanding, that I may resolutely deny them every
gratification, which has no tendency to thy glory. O train me up in
this good way, that when I am old I may not depart from it: that I
may be at length of a truly mortified heart, crucified unto the world,
and the world crucified unto me.
Hear also my prayers for all mankind, and guide their feet into
the way of peace: for thy holy Catholic church, let her live by thy
Spirit, and reign in thy glory. Remember that branch of it which thou
hast planted in these kingdoms; especially the stewards of thy holy
mysteries; give them such zeal, and diligence, and wisdom, that
they may save both themselves and those that hear them.
Preserve, O great King of heaven and earth, all Christian princes,
especially our sovereign and his family. Grant that his council, and all
that are in authority under him, may truly and indifferently
administer justice. And to all thy people give thy heavenly grace,
that they may faithfully serve thee all the days of their life. Bless the
universities with prudence, unity, and holiness. However the way of
truth be evil spoken of, may they walk in it even to the end.
Whoever forget or blaspheme their high calling, may they ever
remember, that they are a chosen generation, a royal priesthood, an
holy nation, a peculiar people: and accordingly, shew forth the praise
of him, who hath called them out of darkness into his marvellous
light.
W E D N E S D A Y E V E N I N G.
T H U R S D A Y M O R N I N G.
O ETERNAL God, my Sovereign Lord, I acknowledge all I am, all I
have is thine. O give me such a sense of thy infinite
goodness, that I may return to thee all possible love and obedience.
I humbly and heartily thank thee for all the favours thou hast
bestow’d upon me; for creating me after thine own image, for thy
daily preserving me by thy good providence, for redeeming me by
the death of thy blessed Son, and for the assistance of thy holy
Spirit: for causing me to be born in a Christian country, for blessing
me with plentiful means of salvation, with religious parents and
friends, and frequent returns of thy ever blessed sacrament. I also
thank thee for all thy temporal blessings; for the preservation of me
this night, (――) ¹ for my health, strength, food, raiment, and all the
comforts and necessaries of life. O may I always delight to praise thy
holy name, and, above all thy benefits, love thee my great
benefactor.
*O thou all-sufficient God of angels and men, who art above all,
and through all, and in all; from whom, by whom, and in whom are
all things; in whom we live, move, and have our being; may my will
be as entirely and continually derived from thine, as my being and
happiness are!
I believe, O sovereign goodness, O mighty wisdom, that thou
dost sweetly order and govern all things, even the most minute,
even the most noxious, to thy glory, and the good of those that love
thee! I believe, O Father of the families of heaven and earth, that
thou so disposest all events, as may best magnify thy goodness to
all thy children, especially those whose eyes wait upon thee. I most
humbly beseech thee teach me to adore all thy ways, though I
cannot comprehend them: teach me to be glad that thou art king,
and to give thee thanks for all things that befall me; seeing thou
hast chosen that for me, and hast thereby set to thy seal that they
are good. And for that which is to come, give me thy grace to do in
all things what pleaseth thee, and then, with an absolute submission
to thy wisdom, to leave the issues of them in thy hand.
T H U R S D A Y E V E N I N G.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com