








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









Jianjian Song Department of Electrical and Computer Engineering
- March Rose-Hulman Institute of Technology Install LogicWorks 4 from the CD from the book LogicWorks 4 Interactive Circuit Design Software. You will need to install an update patch LW410Update.exe that is available from http://www.capilano.com/LogicWorks/lw400/lw4update.html or http://www.rose- hulman.edu/class/ee/song/ece130/.
0
0
0
0 0
0
160,
80,
40,
Flash(F)
Left(L) Left_turn(LT)
Right_turn(RT) Right(R)
After you start LogicWorks 4, you should see a tool palette, a simulation palette, a schematic circuit and symbol editor window, a timing diagram window, and a device library palette.
On the device library palette, choose “Simulation Gate.clf” with the left mouse button. Find two- input AND gate, AND-2. Double click the left mouse button to pick AND-2. Move the cursor to the schematic window. Press one of the four arrow keys on the keyboard to change orientation of the device. Each time the left mouse button is pressed a copy of the chosen device is placed on the schematic window. Click the right mouse button to drop the device. Do the same for two-input OR gates OR-2 and inverters that is denoted NOT gate in the library. You can rearrange the gate positions by picking one up and dragging it with the left mouse button. You can copy a gate by choosing it and choosing Edit->Copy (Control-C) and then Pasting it.
To connect two pins with a wire, select the end of one pin with left mouse button and pressing and dragging the cursor to the end of the other pin. The wire can be placed piece by piece at right
Select Clock from the Simulation IO library. Connect one clock to each input pin. Notice waveforms are being generated in the timing diagram window. To slow the waveform movement, drag to the left the speed marker in the simulation palette in between two black figures. Time interval is assumed to be a unit time, which can be defined as any convenient value. To change clock period, select a clock, open Simulation Parameters Dialog Box in Simulation menu, change low and high intervals of the clock. Clock period can be made visible. Select a clock with cursor, click right button to open Device Parameter Box. Choose Device Info, choose Attributes, select delay.Dev, and choose Visible. Once the clock period is visible, double click on it will open a dialog box where the period can be changed. Clicking on the sitting man in the simulation palette can stop simulation. Clicking once on the walking man will move simulation one step further (Single Step Mode). You may need to reset your simulation once in a while to make sure the signals are synchronized. The U-turn button on the simulation palette will reset simulation to start at time 0.
Each gate has a default delay time of 1 time unit associated with it. The delay time could be set to zero. To display device delay, select a device with cursor, click right button to open Device Parameter Box. Choose Device Info, choose Attributes, select delay.Dev, and choose Visible. Once device delay time is shown, click on it twic e will open a delay time box. Device delay in the box can be changed. Another way to change device delay is to choose the device and select Simulation Parameters in Simulation Menu. Type a new delay time in delay column and choose OK.
Page 180 of the LogicWorks 4 reference manual explains the Trigger button that shows as a small handgun in Simulation Palette. Click on the button to open Trigger Setup Box. Choose EVERY, 10 TIME UNIT, and REFERENCE LINE to add one reference bar on the timing diagram for every 10 time unit. Click OK.
In order to generate all possible input combinations of the three input signals, change the periods of the clock signals so that they differ by multiple of 2s. For example, the three clocks can have periods of 320, 160, and 80 respectively. Click the U-turn button on Simulation Palette to reset simulation. Click the running man to run simulator. Click the sitting man to stop it. Move the speed marker bar to change the speed of simulation. All input combinations should appear once during one period of the slowest clock, which is 320 units in this example. You can check one such period to verify the function of the circuit.
Run simulation with single steps after reset (click on the walking person on Simulation Palette) until a complete period of the slowest clock and observe the output waveforms to see how device delay affects the outputs. Check one period of the slowest clock to obtain the output values.
A schematic can be copied to a PowerPoint or Word file through normal copy and paste commands. When you paste a schematic into a Word file, it will be floatin g over text. To change the image position, Click the left mouse button while the cursor is on the image. Click the right mouse button to open Format Picture Box. Choose Position and mask out Float Over Text. To copy a timing diagram, drag the cursor in the timing window to choose (mask) a section of the diagram that will become shaded. While the cursor is in the chosen area, click the right mouse button to copy the section. Inside a PowerPoint or Word file, choose Paste Special and Paste Bitmap.
Flash(F)
Left(L) Left_turn(LT)
Right_turn(RT) Right(R)
To make a signal appear in a timing diagram without its own waveform, select the signal in Timing Window, press the right mouse button and choose Remove command to delete the signal from the timing diagram. Run and stop simulation. Click on the removed signal in Schematic Window. Select Add To Timing in Simulation Menu to add the signal to the timing diagram. Now the signal will appear with no waveform.
Every pin that will appear in the device symbol must be declared as a port in a sub-circuit. Once the ports are defined, all switches and clocks should be removed from the circuit pins.
0
0
0
0 0
0
L
F
R
LEFT
RIGHT
Left
Left Flash
Flash
Right Right
Left_turn
Left_turn
Right_turn
Right_turn
Leave the turn-signal circuit open.
Open a new file. Three options will appear: Design, Text document, Device Symbol. Choose Device Symbol and click OK. The device symbol editor is opened. In Options menu, select Sub-circuit/Part Type command. In Part Type, choose “Create a sub-circuit symbol and select an open circuit to attach to it.”
When Select Internal Circuit dialog opens, click on the turn-signal sub-circuit. Click OK and then Done. The symbol editor has extracted all port names from the port connectors in the sub-circuit and placed them in the Pin List at the left side of the device symbol window.
In Options menu, select Auto Create Symbol. This will bring up a dialogue box with five fields for you to place text into. In the “Left Pins” field, type the names of the inputs. Separate pin names by spaces. DO NOT HIT RETURN. In the “Right Pins” field, type the names of the outputs. Type the names of the control lines in either the “Bottom Pins” or “Top Pins” field. Place the name you would like to call the symbol in the “Part Name” field in the middle of the dialogue box.
Click on Generate Symbol and the symbol will be automatically generated for you.
To create a symbol manually, follow the steps below.
Click on each pin in the Pin List and give it a pin number. Create a symbol for the circuit with any symbol shape.
Place pins on the symbol by selecting the pin tool.?. with proper directions. Notice that each new pin corresponds to one pin in the Pin List until all pins in the Pin List are represented on the device symbol.
If you create a symbol manually, you need to name all the pins. Use the text icon (button with letter A) in the Tool Palette to place a name for each pin inside the device symbol box.
Open Part Attributes in Options, add a name to the device symbol such as turn-signal and make it always visible. You can change the orientation of a text string with Text Rotation in Options menu.
When you choose Save or Save As in File menu, you will be prompted to choose a library to save the symbol. Click New Library button to create a new library. Name it my_library and save it in folder LogicWorks 4.0\Libs. Name your symbol “turn_signal” as part name for this part and save it in my_library.
Close the symbol editor and be sure you have saved your sub-circuit.
Open a new design file. Get a component turn_signal from my_library. Add probes and binary switches to the outputs and inputs of the device as follows. Verify its functionality.
Double click on the symbol to see the sub-circuit. Click Pop Up in Schematic menu to get back to the top circuit.
We have created a device symbol with bottom-up approach in the previous sections. Now we want to create a device symbol with top-down approach. Open a new device symbol window. Create a symbol and place five pins. The pins are called PIN1, PIN2, etc. Double click on a pin name and then type another name to change the name. Name the pins to match the pin names in the turn-signal circuit such as R, F, L, RIGHT, LEFT, etc.
1
2
3
4
5
L
F
R
LEFT
RIGHT Rose-Hulman
L
F R
LEFT
Rose-HulmanRIGHT
1
2
3
4
5
Turn_Signal
0
1
0
1
0
1
0
1
Open a new file for creating a device symbol. In Device Symbol Editor, Choose “Set to primitive type” in Options-> subcircuit/part type and then choose Port Connector. The symbol will then be of Type Port Connector. Create a number of pins for a bus by choosing Option->Add pins with, for example, INPUT[A0..A3] for a four-bit input bus that has signals A0 to A3. The signal names must match those that the bus is to be connected to. Therefore each bus port connector can only be used once to connect signals with same names. A bus internal pin can be either output or input or bi-directional. Set pins on a bus to be output pins if the pins are to be connected to inputs of a sub-circuit. Draw a bus symbol that can be any shape you want. Select a bus pin from the symbol palette and place it on the bus symbol. There are four bus pins, one for each side of the bus symbol. A screen capture on the right shows how a 4-bit input bus port can be created. Notice that the pin functions are designated as Output, although the bus port is an input bus port. Make sure the pin directions and the number of pins match the intended application. Save the port connector symbol to your own library. The following are two sample port connector symbols.
4-bit Bus Port In
(^1) bus port out
Bus port connectors can be used like Port In and Port Out connectors in a sub-circuit. When connecting a bus port to a breakout, make sure the corresponding pin names are exactly the same. For example, the breakout D0-3 matches the Bus Port In that has input pins D0-3. Here is a subcircuit with the bus ports.
D D D D
Q Q Q Q CLK
LD
CLR
C
DEV
clear
load
clock carry_out
Q
Q
Q
Q
D
D
D
D
Bus Port In
bus port out
The procedure is the same as that of creating a device symbol from a subcircuit. However, pin function for input pins should now be changed to Input. And pin function for output pins should be Output as shown in the following picture. When a subcircuit with bus ports is attached to a device symbol, it is possible that the pin directions are all reversed. Therefore, it may be necessary to manually change pin directions. Check all pin directions to make sure they are correct, i.e., output pins should have pin type of output and input pins should have pin types of input.
load clear
clock carry_out
D3-0 Q3-
4-bit counter
2 1
3 4
5 10
After a bus port is connected to pins in a subcircuit, right click on the bus symbol to open Device Info window. Check each pin of the bus to see if their types are correct. For example, all the pins of an output bus port should have pin type of Output.
Once a device symbols is corrected. Get a copy of it in a schematic window. Right click on a bus pin of the device symbol to open Bus Pin Info window. Choose a pin and click Pin Info to find out if the pin is of correct type. If it does not have the correct type, edit the device symbol to check if the pin type is defined correctly.
After modifying a bus port in a subcircuit, the subcircuit needs to be detached and reattached to the device symbol. A subcircuit can be detached with Schematic ->detach subcircuit at either device symbol level or subcircuit level. A device symbol can get a new subcircuit by selecting it and then choosing Schematic ->attach subcircuit.
numbers as the bit length. LogicWorks reads each line with left alignment. If the number of bits is not 92 on a line, the highest bits will not be initialized.
The first ten byes in each line are ASCII characters and the last three hex numbers are binary numbers. They represent the following text.
Coke $0. Diet Code $0. CherryCoke $3. Lipton Tea $4.
There may be spaces in between the characters and the three digit number if a name has less than ten characters.
Choose Simulation-PROM/RAM/PLA Wizard. Select PROM and click next. In the PROM Symthesizer window, select Read data from a raw hex file and click next. Choose Select Raw Hex File and choose the file to be read from. If there is no error opening the file, it will be read and the ROM will be initialized with content from the file. You can now save the ROM as a component.