Skip to content

Wieku/LogicDraw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

banner.png

Build Status

LogicDraw is an application to perform simulations of logic gates, in which you can paint your circuit like in raster graphics editor.

Application is in early development, so be aware that critical bugs can occur. I don't take responsibility for lost maps and blueprints. But if such thing happens, please submit a new issue.

Elements

Wires

Element Idle color Active color
Wire
Dark wire
Cross
Dark cross

Dark wire and cross have much smaller contrast, so they are helpful in making good-looking displays.

Controllers

Element Idle color Active color
Input
Controller

On non-controllable gates, Controller works like regular input.

Flip-flops

Element Idle color Active color
TFlipFlop
Memory (DFlipFlop)

Flip-flops react to rising-edge signal (option to change it will be added in the future).

Gates

Element Idle color Active color
Or gate
Nor gate
And gate
Nand gate
Xor gate
Xnor gate
Delay gate
PWM generator
Stop gate
Key gate
Programmer gate
RAM gate
IO gate

Stop gate is for circuit debug purposes, so it should not be generally used. It stops the world clock on rising-edge signal.

Key gate is a binding to real-world keyboard, high-level signal disables it.

Programmer gate outputs stored data bit by bit on rising-edge signal.

Display

Element Idle color Active color
White pixel
Red pixel
Green pixel

White, Red and Green pixels work just like regular Wire.

Misc

Element Idle color Active color
Description
IO Gate

IO Gate can be used to output and read to/from the console. It only has single input and 4 states: IDLE, CMD, READ, RESPOND. Normally (when input is low) gate is IDLE. States change in the following way:

  • IDLE && high -> CMD
  • CMD && low -> READ
  • CMD && high -> RESPOND

After entering READ, the gate will form a byte from bits read over 8 ticks in a way that the least significant bit is read last. After all bits are read, it will output the byte to the console and back into IDLE.

After entering RESPOND, the gate will check if there is data in console buffer, output low and go into IDLE if there isn't, or output high and 8 bits of the first character in console buffer, starting from the lowest bit, and then go into IDLE

RAM Gate

It's.. complicated. Try reading https://gist.github.com/magik6k/d1a739a5f032e93aba2742b9fa243a26

How to run it

To run the project, just type: ./gradlew desktop:run (gradlew desktop:run on Windows CMD)

Example circuits

BCD adder:

bcdadder

27 bit divider with 7 bit fraction:

divider

White 7 segment display with bcd decoders, showing result from the division above:

display

4 digit shift register (digits are typed by keyboard):

shift

About

Raster editor and simulator of logic circuits

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages