SimcirJS

SimcirJS(a.k.a. Simcir) is a circuit simulator in HTML5 and JavaScript.
Let's try your circuit!

Usage

InOutJointDCLEDPushOffPushOnToggleBUFNOTANDNANDORNORXORXNOROSC7seg16seg4bit7segRotaryEncoderx8BusInx8BusOut~S~RQ~QRS-FFJCLKKQ~QJK-FFTCLKQ~QT-FFDCLKQ~QD-FFTCLKD0D1D2D3D4D5D6D78bitCounterABSCHalfAdderCinABSCoutFullAdderCinA0A1A2A3B0B1B2B3S0S1S2S3Cout4bitAdderD0D1OEA0A1A2A32to4BinaryDecoderD0D1D2OEA0A1A2A3A4A5A6A73to8BinaryDecoderD0D1D2D3OEA0x8A1x84to16BinaryDecoder

Embed your circuit

Ctrl+Click(Mac:command+Click) on your circuit and copy a circuit data.
Then paste it into template below.

<!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <script type="text/javascript" src="simcir.js"></script> <link rel="stylesheet" type="text/css" href="simcir.css" /> <script type="text/javascript" src="simcir-basicset.js"></script> <link rel="stylesheet" type="text/css" href="simcir-basicset.css" /> <script type="text/javascript" src="simcir-library.js"></script> <title></title> </head> <body> <div class="simcir"> <!-- paste here your circuit data --> </div> </body> </html>

Reuse your circuit

To reuse your circuit as library, use device 'In' and 'Out'.

InOutDCPushOffPushOnToggleNANDDCPushOffPushOff~S~RNANDNANDQ~Q

Then register it in JavaScript and add to the toolbox in HTML.

simcir.registerDevice('MyDevice', // paste here your circuit data );
<div class="simcir"> ⋮ "toolbox":[ {"type":"DC"}, {"type":"PushOff"}, ⋮ {"type":"MyDevice"} ], ⋮ </div>

In this case, a new device 'RS-FF' is added. Try to Double-Click the 'RS-FF' :)
Remember that all the connectors on an input of 'In' and an output of 'Out' are disconnected internally when the device is reused.

DCPushOff~S~RQ~QRS-FFDCPushOffPushOff~S~RQ~QRS-FF

To customize the layout of library, add the "layout" property to your device with a text editor.
"rows" and "cols" define the size. nodes property contains 'label - position' pairs of nodes.

simcir.registerDevice('AltFullAdder', { ⋮ "layout":{"rows":8,"cols":8,"hideLabelOnWorkspace":true, "nodes":{"A":"T2","B":"T6","S":"B4","Cin":"R4","Cout":"L4"}}, "devices":[ ⋮
L1 L0 L2 L3 L4 T0 T1 T2 T3 T4 R0 R1 R2 R3 R4 B0 B1 B2 B3 B4 Left Right Bottom Top rows cols

Customize a device

label, color, number of inputs, freq ...

DCToggleLED(G)NAND(3in)OSC(1Hz)7segNAND(3in)ToggleToggleToggleDCLED(G)OSC(1Hz)NAND(3in)7seg
LED
Params
NameTypeDefaultDescription
typestring-"LED"
labelstringsame with typelabel for a device.
colorstring#ff0000color in hexadecimal.
bgColorstring#000000background color in hexadecimal.
Code
{"type":"LED","color":"#ff0000"}
AND
Params
NameTypeDefaultDescription
typestring-"AND"
labelstringsame with typelabel for a device.
numInputsnumber2number of inputs.
Code
{"type":"AND","numInputs":2}
NAND
Params
NameTypeDefaultDescription
typestring-"NAND"
labelstringsame with typelabel for a device.
numInputsnumber2number of inputs.
Code
{"type":"NAND","numInputs":2}
OR
Params
NameTypeDefaultDescription
typestring-"OR"
labelstringsame with typelabel for a device.
numInputsnumber2number of inputs.
Code
{"type":"OR","numInputs":2}
NOR
Params
NameTypeDefaultDescription
typestring-"NOR"
labelstringsame with typelabel for a device.
numInputsnumber2number of inputs.
Code
{"type":"NOR","numInputs":2}
XOR
Params
NameTypeDefaultDescription
typestring-"XOR"
labelstringsame with typelabel for a device.
numInputsnumber2number of inputs.
Code
{"type":"XOR","numInputs":2}
XNOR
Params
NameTypeDefaultDescription
typestring-"XNOR"
labelstringsame with typelabel for a device.
numInputsnumber2number of inputs.
Code
{"type":"XNOR","numInputs":2}
OSC
Params
NameTypeDefaultDescription
typestring-"OSC"
labelstringsame with typelabel for a device.
freqnumber10frequency of an oscillator.
Code
{"type":"OSC","freq":10}
7seg
Params
NameTypeDefaultDescription
typestring-"7seg"
labelstringsame with typelabel for a device.
colorstring#ff0000color in hexadecimal.
bgColorstring#000000background color in hexadecimal.
Code
{"type":"7seg","color":"#ff0000"}
16seg
Params
NameTypeDefaultDescription
typestring-"16seg"
labelstringsame with typelabel for a device.
colorstring#ff0000color in hexadecimal.
bgColorstring#000000background color in hexadecimal.
Code
{"type":"16seg","color":"#ff0000"}
4bit7seg
Params
NameTypeDefaultDescription
typestring-"4bit7seg"
labelstringsame with typelabel for a device.
colorstring#ff0000color in hexadecimal.
bgColorstring#000000background color in hexadecimal.
Code
{"type":"4bit7seg","color":"#ff0000"}
RotaryEncoder
Params
NameTypeDefaultDescription
typestring-"RotaryEncoder"
labelstringsame with typelabel for a device.
numOutputsnumber4number of outputs.
Code
{"type":"RotaryEncoder","numOutputs":4}
x8BusIn
Params
NameTypeDefaultDescription
typestring-"BusIn"
labelstringsame with typelabel for a device.
numOutputsnumber8number of outputs.
Code
{"type":"BusIn","numOutputs":8}
x8BusOut
Params
NameTypeDefaultDescription
typestring-"BusOut"
labelstringsame with typelabel for a device.
numInputsnumber8number of inputs.
Code
{"type":"BusOut","numInputs":8}

Contents Copyright © Kazuhiko Arase