Execpt the standard devices Klogic has some nice additional devices, wich i will explain now. These
devices are:
They can help you much in developing large and complex circuits, without running out of space or get lost in
placing hundreds of simple devices to get the functionality of one bigger / complex device.
Subcircuits can be placed with the subcircuit button
at the device toolbar. After placing a subcircuit at the
drawbaord you can open it by double-clicking it with the left mouseutton. Alternatively you can open it via the
context-menu by right-clicking it. Within Subcircuits you can create circuits on a new drawboard. You can use
them to integrate a circuit into another circuit. For examble: If you need a counter, just create the counter
in a subcircuit and place it in the maincircuit. Now you have a counter, but it uses much less space on the
maincircuit. This makes creating circuits much easier, because you have an clear overview over your drawboard.
Subcircuits can interact with the maincircuit via Input and Output Devices. These special Devices can be only
placed in subcircuits. They will be shown in the above circuit as input or output with the name you gave them.
By default, a subcircuit is 4 Grid-Units big. This means that it can have 5 InputDevices and 5 OutputDevices.
If you need more then 5 Inputs / Outputs, you have to adjust the size of your Subcircuit in its Properties-Dialog
by rightclicking int and selecting "Properties" from the contextmenu.
Note: The inputs/outputs are shown in the order you placed them into the subcircuit. So if you need to
get them into a special order (for a 4bit wide input i.e.) you need to place them in the right order you want
them to be shown. You cantplace an input/output at the top of the subcircuit. If you need to do this, you
have to delete all other inputs/outputs and place the input/output wich should be at the top first.
Note: You can create subcircuits in another subcircuit.
If you are too lazy for placing many small devices *g* or if you have not enough place for them on your drawbaord,
you can use the Equatation Device. Place it wiht the "Equatation Device"-Button
.
When you open its properties Dialog, you have the Button "Equatation Editor". Press it to open another dialog. Here
you can type in the behaviour of the device as a formula. If you have read the "Simulation" Section of this Doc.
You already should know something about the formulas. Lets create a simple Circuit with the equatation device.
Our aim is to get a circuit with the same properties as shown in the "First Steps" Section.
First place the needed switches and the LED. Now add an Equatation Device and open its Equatation Editor. To
add a formula we have to type it into the text-fields at the lower part of the Dialog. You should know that any
Inputs and Outputs we need are parsed out of the formula we type in. So, if you need an output called "out-1" use
this name in the editor too. Now, lets start. We want to connect the switches with an "AND-GATE" to the LED.
The symbol in the editor for this is "&". Lets call our Inputs "a" and "b" and our output "o". The smaller, left textfield
is for the output. So type an "o" into it. At the right side type the formula. As we want to get an "AND"like
behaviour, type "a&b" and press the "add" Button. Now, our formula is listed in the "Device Equatations" list above.
Now press "ok" at the open dialogs and connect the Switches and the LED with our Equatation Device. Now, when you
activate / deactivate the switches, our Device should behave like an "AND-Gate".
Here is a full list of supported symbols:
- & - This is the logical "AND"
- + - The logical "OR"
- # - Here we get logical "XOR"
- / - Tis symbol is an Inverter
- § - is reserved for bus-operations.
You can use parenthesis (...) to change the preference of an expression.
For examble:
o=a1&a2+a3 means: to get a logical "1" at the output "o" you have to set a3 to log. "1" or "a1" and "a2".
while
o=a1&(a2+a3) means: You have to set "a1" to log. "1" and "a2" or "a3" to get the logical "1" at output "o"
If you don't understand this, feel free to experiment with the formulas and expressions, in most cases you won't
need to use parenthesis, it should be comfortable to work without them.
If you want to create more complex circuits, you will determine the growing amount of wires surrounding your
Devices. This can be hard to overview, especially if you have some subcircuits / equatation Devices with many
inputs/outputs. And its much harder to correct an error, find a specific wire or connect an additional device.
Here comes the Bus Device into play. Select the Bus Device
from from the toolbar and place two Buses into the drawboard. Add two switches and two leds. Place one of the
Bus Devices left of the drawboard, and place the other right. Open the Properties Dialog of the righter Bus
Device and select the BusType "Demultiplexer" and change its size to "2". At the left Bus Device leave the
Bustype as a Multiplexer and change its size to "2" too. Now connect the single output of the left, multiplexer
Busdevice with the single input of the right, demultiplexer device. The wire should look a bit more thick.
Finally connect the switches to the inputs of the left Busdevice and the LED's to the outputs of the right Bus
device. When you activate the upper switch on the left, the upper LED should start to glow. The same applies to
the lower switch and LED. As you can see, we saved one wire for two connected devices. As this sounds not to make
it easier think of a 8bit wide input of a counter. Here you can save 7 wires with the Busdevice. Also you don't
have to connect inputs and outputs of the same two devices via a bus. You can connect many different devices together
using one single bus. The only Disadvantage of the Bus is its delay. As you know, each devicehas a delay, so a bus
has a delay of 2 steps. One for the multiplexer, and another for the multiplexer. You should know this if you make
haevy use of buses.
This Device is a large Collection of Flip-Flops. If you need to save a large amount of states, or you want to simulate
a processor like circuit, this device may be useful. You dont need to place many single Flip-Flops, summarize them
with subcircuits and design an (sub)circuit to adress every single flip-flop. I tried to do this, with an older Version
of klogic, without the RAM-Device, it was terrible. I gave up after i had a 16X4 Subcircuit....
To place the 328 Ram, select it's Button
from the toolbar
and place it at the drawboard. You will notice eight inputs named d0-d7, these are the data inputs. Here you can
connect the output of a device wich states you want to save. Additional there are five inputs, called A0-A4. Here
you have the inputs for adressing a particular memory-cell. The input on top of the ram-device called "WR", is for
writing into a memory-cell. All inputs are binary, so if you want to write to the memory-cell "5" you have to put
a logic "1" to the inputs A0 and A2, and at the input "WR" to enable writing access to the ram. Now the signal states
at the inputs D0-D7 are written to the memory-cell 5 and displayed at the outputs Do-D7. The outputs everytime
display the signal states of the memory-cell, wich is called at the adress-inputs A0-A4. Note: No signal or
or logical "0" at every adressinput means memory-cell "0"! When the "WR" input has logical "0", the Data inputs
will be ignored, just the outputs will display the contents of the memory-cell wich is called by the inputs A0-A4.
If you have just placed a 32X8 Ram Device, its memory is randomized. This means, it is not empty. Bits in the
memory are set, some arent.
When you get closer to klogic, you will get into the following Situation:
Once you created a circuit wich had a special subcircuit, lets say a binary-counter.
If you want to use this counter again, you have to close your current project, (search and) open the old circuit
or subcircuit, copy it, reopent your project wich you areworkingon, and paste the subcircuit there. This isn't
comfortable, so here are the Libraries:
Select the "Library Maintenance" Option from the File Menu. A dialog will pop up, where you can select a library,
add a device, etc.
If you haven't already done it, create a new library. Do this by pressing the "New" Button on top of the Dialog,
and select a filename and a folder for your library. After you've done, click ok, and a new toolbar will appear
at the top of the klogic window. It should show you your library in a drop-down-box and a additional drop-down-box
wich is empty. Now create a subcircuit, place some devices into it, and connect them. After doing this (and maybe
testing the subcircuit) right click at the subcircuit you've just created and select "add to lib" from the contextmenu.
The Library Maintenance Dialog should pop up again, and now, the lower textfields get interesting. Type in the
required information (Give your circuit a name, Your name and maybe a useful comment) and click the "Add" Button.
After pressing ok, you will be asked if you want to save the changes at the Library. Confirm this by pressing the
"Ok" Button. Now, at the before empty drop-down-box at the Librarytoolbar, you can select your subcircuit with
the name you gave it. Select it and you can place as many as you want of them at your drawbaord. Now, every time
you need a subcircuit with this functionality, you can load the library and place it from there.