Skip to content

A functional prototype aimed at simulating combinatorial and sequential logic gates in Swift

Notifications You must be signed in to change notification settings

shiles/Logic-Gate-Simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Logic Gate Simulator

Overview

A funtional prototype for the simulation used in the Logic-Gate-Recogniser project. It supports simulating both combinatorial and sequential logic. The simulation will continue to execute until a stable circuit is found.

The follow gates are supported:

  • NOT
  • AND
  • NAND
  • OR
  • NOR
  • XOR
  • XNOR
  • INPUT
  • OUTPUT

Example Circuit

Circuits are built programatically, here is an example of a simple not gate, with in input and and output. This can be passed to the Runner which will simulate it and produce a output value.

// Initialise Gates
let input = Input(initialValue: true)
let not = Not()
let output = Output()

// Make Connections
not.inputs = [input]
output.inputs = [output]

// Built Model
let model = [input, not, ouput]

About

A functional prototype aimed at simulating combinatorial and sequential logic gates in Swift

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages