Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Principles of Computer Organization CS240
Lab 0: Introduction to tkgate and Thinking About Circuits
Part I: tkgate
Check out the files for cs240 lab 0, for example by starting Eclipse and using the CVS Repository
Exploring perspective as you did in CS105 and CS106. Almost any other perspective (C++,
Java, Pydev) should let you see the files you checked out, namely lab0a.v, lab0b.v, and
README.txt. If double-clicking on lab0a.v does not start tkgate, follow the instructions in
README.txt to configure Eclipse so that it will. Then open and follow the instruction in the files
lab0a.v and lab0b.v to build the circuits shown on the attatched pages (the starter files have
the same comments but with the circuitry left out).
You may also, if you wish, start the tkgate tutorial by selecting “tkgate intro” from the Tutorials
sub-menu of the Help menu in the upper right of the tkgate window. You’ll need to be familiar
with everything up to (and including) “combinational simulation” fairly soon, but we won’t be
working with “sequential simulation” for a few weeks.
Part II: Circuits
The switches we’ve seen in tkgate are simpler than real switches, in that they can only be used to
make a wire connect to the power (in the up position) or not (in the down position). Similarly,
tkgate lights (such as the LED’s used above) implicitly have one wire connected to the ground, so
that applying power at the other will always make them light up. Real switches and lights can, of
course, be connected to any kind of component, and this allows for some interesting circuits that
cannot be drawn with tkgate, as we will see below. (It also creates a great deal of uninteresting
complexity as we make connections to power and/or ground for switches, lights, and almost every
other component; this is perhaps why it is omitted from tkgate.)
Two common kinds of switches that are used to control lights in buildings are two-way switches
and three-way switches. The first has two connections (A and B below); in one position (which
we’ll call “up”), A and B are connected (as if with a wire); in the other position (“down”), A and
B are not connected. A three-way switch has three connections (A, B, and C below); in the up
position, A is connected to B and C is not connected to anything; in the down position, A is con-
nected to C, and B is not connected to anything.
Most building lighting has one or more lights controlled by a single two-way switch: connection A
on the switch is connected to the power, and connection B to one connection on a light, and the
other connection on the light bulb is then connected to the ground. Thus, when the switch is up,
current runs from the power side of the power supply to A, then from A to B, from B to one side
of the lightbulb, through the bulb (producing light), and then out the other side of the bulb to
the ground. When the switch is down, no current flows. (This is the circuit in lab0a.v.)
B
A
C
B
A
C
A BA B
up position
Two−way switch
down position
Three−way switch
up position down position
Design, on paper, a circuit that will allow a light to be controlled by either of two switches (as
in H110). When either switch is flipped, the light will switch as well (from on to off, or from off
to on, depending on whether it was on or off before the switch was flipped). Include the power
supply in your circuit drawing.
1