Skip to content

Instantly share code, notes, and snippets.

@anuragteapot
Last active November 13, 2018 13:29
Show Gist options
  • Save anuragteapot/ffd3dbbbe7fa21fac44c1bcd6a9d2111 to your computer and use it in GitHub Desktop.
Save anuragteapot/ffd3dbbbe7fa21fac44c1bcd6a9d2111 to your computer and use it in GitHub Desktop.
MSW - Machine with Shuffled Wires

MSW - Machine with Shuffled Wires

MSW is a CPU 16-bit, RISC, Unicycle, Harvard, built in Logisim. It was developed in order to be as simple as possible, so also does not have pipeline, branch prediction, cache, among others features.

msw overview

Architecture

Inspired by the 8086 Intel and MIPS, but much simpler, its instruction set has 16 instructions and similar registers with Intel. Its general architecture looks like a MIPS unicycle.

It is divided into 4 parts:

  • ALU - Arithmetic Logic Unit
  • UControl - Unity Control, responsible for creating control flags throughout the CPU, according to the instruction currently running.
  • BRegs - Bank registers
  • CPU - With the full assembly of the other modules.

Instruction Set

The MSW's instructions follows the format below:

 OpCode      R1   R2              Imm
/-------\    /-\ /-\     /------------------\    - Immediate instructions.
 0 0 0 0     0 0 0 0     0 0 0 0      0 0 0 0

and

OpCode      R1   R2           Constant
/-------\    /-\ /-\     /------------------\    - Only registers.
 0 0 0 0     0 0 0 0     1 1 1 1      1 1 1 1

Needless to say, supports 16 instructions and 4 registers: AX, BX, CX and DX.
* Due the use of 0x00FF to identify Register-only instructions, you shouldn't use 255 as immediate value.

The following table illustrates all instructions:

Op Code Instruction Behavior
0 OR REGDest,REGSource/Imm REGDest <- REGDest | REGSource
1 NOT REGDest REGDest <- ~REGDest
2 AND REGDest,REGSource/Imm REGDest <- REGDest & REGOri
3 XOR REGDest,REGSource/Imm REGDest <- REGDest ^ REGOri
4 ADD REGDest,REGSource/Imm REGDest <- REGDest + REGOri
5 SUB REGDest,REGSource/Imm REGDest <- REGDest - REGOri
6 MULT REGDest,REGSource/Imm REGDest <- REGDest * REGOri
7 DIV REGDest,REGSource/Imm REGDest <- REGDest / REGOri
8 MOV REGDest, REGSource REGDest <- REGSource
9 MOV REGDest, Imm REGDest <- Imm
10 LOAD REGDest, REGSource REGDest <- MEM[REGSource]
11 STORE REGDest, REGSource MEM[REGDest] <- REGSource
12 JMPZ REGDest/Label JuMP if Zero
13 JMPN REGDest/Label JuMP if Negative
14 JMPP REGDest/Label JuMP if Positive
15 HALT Halts CPU

Assembler

In order to avoid programming in binary, it developed a Assembler, which takes a file as input and generates a hex file ready to run and a code like below can be perfectly executed on the CPU:

##################
##FibonAsm, ^.^###
##################

#Calculation of Fibonacci

mov ax,1   #i
xor bx,bx  #j
xor cx,cx  #<-- mem
mov dx,14  #counter

fibo:
	add   ax,bx  #i=i+j
	store cx,ax  #mem[0] = i
	mov   ax,bx  #i=j
	load  bx,cx  #j=mem[0]
	sub   dx,1   #count=count-1
	jmpp  fibo
halt

#Result in bx

The assembler is case insensitive for instruction names, supports labels and comments.

To run the generated program (.hex), just load it to the leftmost memory and activate the clock. Here is a video of the CPU in operation (Portuguese).

What comes next?

This is my first CPU and I believe there are some design issues in both the CPU and the Assembler (not bugs, just the way I developed).

So I don't intend to go far with it, there are still some things I want to add such as stack and I/O instructions, but the ideal would be a re-work on a new CPU, very different from this first, starting with microcode addition eg.


That's it, if you have questions, suggestions or want to contribute, feel free to ask me, I would love hear from you.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project source="2.7.1" version="1.0">
This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
<lib desc="#Wiring" name="0"/>
<lib desc="#Gates" name="1"/>
<lib desc="#Plexers" name="2"/>
<lib desc="#Arithmetic" name="3"/>
<lib desc="#Memory" name="4">
<tool name="ROM">
<a name="contents">addr/data: 8 8
0
</a>
</tool>
</lib>
<lib desc="#I/O" name="5"/>
<lib desc="#Base" name="6">
<tool name="Text Tool">
<a name="text" val=""/>
<a name="font" val="SansSerif plain 12"/>
<a name="halign" val="center"/>
<a name="valign" val="base"/>
</tool>
</lib>
<main name="CPU"/>
<options>
<a name="gateUndefined" val="ignore"/>
<a name="simlimit" val="1000"/>
<a name="simrand" val="0"/>
</options>
<mappings>
<tool lib="6" map="Button2" name="Menu Tool"/>
<tool lib="6" map="Button3" name="Menu Tool"/>
<tool lib="6" map="Ctrl Button1" name="Menu Tool"/>
</mappings>
<toolbar>
<tool lib="6" name="Poke Tool"/>
<tool lib="6" name="Edit Tool"/>
<tool lib="6" name="Text Tool">
<a name="text" val=""/>
<a name="font" val="SansSerif plain 12"/>
<a name="halign" val="center"/>
<a name="valign" val="base"/>
</tool>
<sep/>
<tool lib="0" name="Pin">
<a name="tristate" val="false"/>
</tool>
<tool lib="0" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="labelloc" val="east"/>
</tool>
<tool lib="1" name="NOT Gate"/>
<tool lib="1" name="AND Gate"/>
<tool lib="1" name="OR Gate"/>
</toolbar>
<circuit name="CPU">
<a name="circuit" val="CPU"/>
<a name="clabel" val=""/>
<a name="clabelup" val="east"/>
<a name="clabelfont" val="SansSerif plain 12"/>
<wire from="(30,220)" to="(30,540)"/>
<wire from="(350,380)" to="(410,380)"/>
<wire from="(570,450)" to="(570,460)"/>
<wire from="(600,30)" to="(600,360)"/>
<wire from="(640,200)" to="(640,210)"/>
<wire from="(40,310)" to="(100,310)"/>
<wire from="(780,320)" to="(900,320)"/>
<wire from="(130,280)" to="(190,280)"/>
<wire from="(100,300)" to="(100,310)"/>
<wire from="(350,390)" to="(400,390)"/>
<wire from="(710,230)" to="(1090,230)"/>
<wire from="(40,230)" to="(40,310)"/>
<wire from="(530,790)" to="(890,790)"/>
<wire from="(80,120)" to="(320,120)"/>
<wire from="(810,130)" to="(810,160)"/>
<wire from="(1030,510)" to="(1130,510)"/>
<wire from="(660,460)" to="(660,490)"/>
<wire from="(740,420)" to="(740,450)"/>
<wire from="(750,470)" to="(750,510)"/>
<wire from="(1240,440)" to="(1250,440)"/>
<wire from="(1050,410)" to="(1060,410)"/>
<wire from="(660,260)" to="(1000,260)"/>
<wire from="(790,60)" to="(810,60)"/>
<wire from="(350,410)" to="(380,410)"/>
<wire from="(660,170)" to="(820,170)"/>
<wire from="(970,510)" to="(970,670)"/>
<wire from="(1000,260)" to="(1000,420)"/>
<wire from="(410,490)" to="(420,490)"/>
<wire from="(520,200)" to="(530,200)"/>
<wire from="(320,400)" to="(330,400)"/>
<wire from="(640,230)" to="(710,230)"/>
<wire from="(350,110)" to="(360,110)"/>
<wire from="(180,300)" to="(190,300)"/>
<wire from="(440,380)" to="(520,380)"/>
<wire from="(120,280)" to="(130,280)"/>
<wire from="(80,280)" to="(90,280)"/>
<wire from="(340,140)" to="(340,190)"/>
<wire from="(620,400)" to="(700,400)"/>
<wire from="(130,280)" to="(130,400)"/>
<wire from="(20,290)" to="(90,290)"/>
<wire from="(660,460)" to="(670,460)"/>
<wire from="(380,410)" to="(380,530)"/>
<wire from="(1030,430)" to="(1030,480)"/>
<wire from="(750,470)" to="(760,470)"/>
<wire from="(230,290)" to="(360,290)"/>
<wire from="(730,450)" to="(740,450)"/>
<wire from="(750,350)" to="(760,350)"/>
<wire from="(30,540)" to="(480,540)"/>
<wire from="(700,250)" to="(1010,250)"/>
<wire from="(1250,440)" to="(1250,590)"/>
<wire from="(840,50)" to="(840,60)"/>
<wire from="(1060,440)" to="(1100,440)"/>
<wire from="(440,630)" to="(1130,630)"/>
<wire from="(10,210)" to="(640,210)"/>
<wire from="(730,130)" to="(730,450)"/>
<wire from="(30,220)" to="(530,220)"/>
<wire from="(520,600)" to="(520,670)"/>
<wire from="(520,670)" to="(880,670)"/>
<wire from="(380,700)" to="(680,700)"/>
<wire from="(360,810)" to="(980,810)"/>
<wire from="(540,720)" to="(960,720)"/>
<wire from="(10,210)" to="(10,550)"/>
<wire from="(820,60)" to="(820,150)"/>
<wire from="(1190,480)" to="(1190,490)"/>
<wire from="(410,460)" to="(410,490)"/>
<wire from="(820,150)" to="(820,170)"/>
<wire from="(420,670)" to="(520,670)"/>
<wire from="(700,250)" to="(700,400)"/>
<wire from="(130,400)" to="(160,400)"/>
<wire from="(820,60)" to="(840,60)"/>
<wire from="(980,700)" to="(980,810)"/>
<wire from="(710,230)" to="(710,340)"/>
<wire from="(890,140)" to="(890,180)"/>
<wire from="(740,420)" to="(760,420)"/>
<wire from="(700,450)" to="(730,450)"/>
<wire from="(40,230)" to="(640,230)"/>
<wire from="(910,280)" to="(910,830)"/>
<wire from="(360,530)" to="(360,570)"/>
<wire from="(340,190)" to="(490,190)"/>
<wire from="(490,580)" to="(500,580)"/>
<wire from="(360,110)" to="(360,290)"/>
<wire from="(440,390)" to="(520,390)"/>
<wire from="(410,380)" to="(410,440)"/>
<wire from="(40,170)" to="(40,230)"/>
<wire from="(790,50)" to="(790,60)"/>
<wire from="(780,320)" to="(780,330)"/>
<wire from="(350,130)" to="(730,130)"/>
<wire from="(550,770)" to="(550,780)"/>
<wire from="(540,720)" to="(540,730)"/>
<wire from="(400,830)" to="(910,830)"/>
<wire from="(810,160)" to="(810,360)"/>
<wire from="(820,170)" to="(820,370)"/>
<wire from="(810,60)" to="(810,130)"/>
<wire from="(750,280)" to="(750,350)"/>
<wire from="(620,410)" to="(660,410)"/>
<wire from="(10,550)" to="(440,550)"/>
<wire from="(1000,460)" to="(1100,460)"/>
<wire from="(520,180)" to="(620,180)"/>
<wire from="(420,590)" to="(420,670)"/>
<wire from="(1010,250)" to="(1010,400)"/>
<wire from="(360,590)" to="(360,810)"/>
<wire from="(960,700)" to="(960,720)"/>
<wire from="(860,420)" to="(860,570)"/>
<wire from="(660,260)" to="(660,410)"/>
<wire from="(1090,490)" to="(1170,490)"/>
<wire from="(660,160)" to="(810,160)"/>
<wire from="(820,150)" to="(840,150)"/>
<wire from="(80,120)" to="(80,280)"/>
<wire from="(1000,420)" to="(1000,460)"/>
<wire from="(380,590)" to="(380,700)"/>
<wire from="(750,280)" to="(910,280)"/>
<wire from="(680,470)" to="(680,700)"/>
<wire from="(550,780)" to="(640,780)"/>
<wire from="(810,130)" to="(840,130)"/>
<wire from="(750,510)" to="(970,510)"/>
<wire from="(640,230)" to="(640,460)"/>
<wire from="(480,540)" to="(480,580)"/>
<wire from="(810,470)" to="(810,530)"/>
<wire from="(20,290)" to="(20,530)"/>
<wire from="(320,400)" to="(320,580)"/>
<wire from="(570,460)" to="(640,460)"/>
<wire from="(400,590)" to="(400,830)"/>
<wire from="(1090,230)" to="(1090,270)"/>
<wire from="(530,590)" to="(1250,590)"/>
<wire from="(470,30)" to="(600,30)"/>
<wire from="(880,140)" to="(890,140)"/>
<wire from="(660,440)" to="(670,440)"/>
<wire from="(350,400)" to="(420,400)"/>
<wire from="(760,470)" to="(760,480)"/>
<wire from="(710,340)" to="(760,340)"/>
<wire from="(1030,500)" to="(1030,510)"/>
<wire from="(540,450)" to="(540,720)"/>
<wire from="(540,90)" to="(540,360)"/>
<wire from="(880,670)" to="(880,680)"/>
<wire from="(640,460)" to="(640,780)"/>
<wire from="(250,440)" to="(250,450)"/>
<wire from="(1060,410)" to="(1060,440)"/>
<wire from="(700,400)" to="(760,400)"/>
<wire from="(60,330)" to="(110,330)"/>
<wire from="(1130,480)" to="(1130,510)"/>
<wire from="(660,180)" to="(890,180)"/>
<wire from="(440,550)" to="(440,570)"/>
<wire from="(380,530)" to="(810,530)"/>
<wire from="(660,410)" to="(660,440)"/>
<wire from="(470,50)" to="(580,50)"/>
<wire from="(530,760)" to="(530,790)"/>
<wire from="(1090,290)" to="(1090,490)"/>
<wire from="(1170,480)" to="(1170,490)"/>
<wire from="(530,200)" to="(530,220)"/>
<wire from="(890,710)" to="(890,790)"/>
<wire from="(110,300)" to="(110,330)"/>
<wire from="(840,420)" to="(860,420)"/>
<wire from="(470,70)" to="(560,70)"/>
<wire from="(1000,420)" to="(1020,420)"/>
<wire from="(490,420)" to="(520,420)"/>
<wire from="(900,320)" to="(900,680)"/>
<wire from="(490,420)" to="(490,580)"/>
<wire from="(1190,490)" to="(1260,490)"/>
<wire from="(300,400)" to="(320,400)"/>
<wire from="(660,190)" to="(690,190)"/>
<wire from="(320,580)" to="(340,580)"/>
<wire from="(1130,510)" to="(1130,630)"/>
<wire from="(560,70)" to="(560,360)"/>
<wire from="(20,530)" to="(360,530)"/>
<wire from="(440,590)" to="(440,630)"/>
<wire from="(470,580)" to="(480,580)"/>
<wire from="(400,390)" to="(400,440)"/>
<wire from="(1010,400)" to="(1020,400)"/>
<wire from="(470,90)" to="(540,90)"/>
<wire from="(530,570)" to="(860,570)"/>
<wire from="(580,50)" to="(580,360)"/>
<wire from="(460,490)" to="(660,490)"/>
<comp lib="6" loc="(528,464)" name="Text">
<a name="text" val="R/W"/>
</comp>
<comp loc="(780,330)" name="ALU">
<a name="label" val="setRegister"/>
</comp>
<comp lib="6" loc="(160,117)" name="Text">
<a name="text" val="new PC or Branch address"/>
</comp>
<comp lib="6" loc="(944,507)" name="Text">
<a name="text" val="setFlags"/>
</comp>
<comp lib="0" loc="(40,170)" name="Clock">
<a name="facing" val="south"/>
<a name="label" val="CLK"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="0" loc="(180,300)" name="Constant">
<a name="width" val="16"/>
</comp>
<comp lib="3" loc="(230,290)" name="Adder">
<a name="width" val="16"/>
</comp>
<comp lib="2" loc="(700,450)" name="Multiplexer">
<a name="width" val="16"/>
<a name="enable" val="false"/>
</comp>
<comp lib="4" loc="(1240,440)" name="RAM">
<a name="addrWidth" val="16"/>
<a name="dataWidth" val="16"/>
<a name="bus" val="separate"/>
</comp>
<comp lib="1" loc="(970,670)" name="AND Gate">
<a name="facing" val="north"/>
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="2" loc="(1050,410)" name="Multiplexer">
<a name="width" val="16"/>
<a name="enable" val="false"/>
</comp>
<comp lib="6" loc="(757,668)" name="Text">
<a name="text" val="mem/alu instruction"/>
</comp>
<comp lib="6" loc="(958,807)" name="Text">
<a name="text" val="setFlag"/>
</comp>
<comp lib="0" loc="(1260,490)" name="Constant">
<a name="facing" val="west"/>
</comp>
<comp lib="1" loc="(1030,480)" name="NOT Gate">
<a name="facing" val="north"/>
<a name="size" val="20"/>
</comp>
<comp lib="6" loc="(1057,73)" name="Text">
<a name="text" val="MSW16 - Machine with Shuffled Wires 16 bit"/>
</comp>
<comp lib="4" loc="(120,280)" name="Register">
<a name="width" val="16"/>
<a name="label" val="PC"/>
</comp>
<comp lib="5" loc="(840,50)" name="LED">
<a name="facing" val="south"/>
<a name="color" val="#ecf055"/>
<a name="label" val="NG"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="6" loc="(1169,397)" name="Text">
<a name="text" val="Data memory"/>
</comp>
<comp lib="0" loc="(470,30)" name="Probe">
<a name="radix" val="10unsigned"/>
<a name="label" val="RegDX"/>
</comp>
<comp lib="6" loc="(724,604)" name="Text">
<a name="text" val="memOut"/>
</comp>
<comp lib="6" loc="(1056,628)" name="Text">
<a name="text" val="load/store instruction"/>
</comp>
<comp lib="0" loc="(460,490)" name="Bit Extender">
<a name="type" val="sign"/>
</comp>
<comp lib="6" loc="(982,315)" name="Text">
<a name="text" val="Reg2"/>
</comp>
<comp lib="6" loc="(898,166)" name="Text">
<a name="text" val="PF"/>
</comp>
<comp lib="1" loc="(890,710)" name="OR Gate">
<a name="facing" val="south"/>
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="1" loc="(1090,290)" name="NOT Gate">
<a name="facing" val="south"/>
<a name="size" val="20"/>
</comp>
<comp lib="1" loc="(490,190)" name="AND Gate">
<a name="facing" val="west"/>
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="0" loc="(470,90)" name="Probe">
<a name="radix" val="10unsigned"/>
<a name="label" val="RegAX"/>
</comp>
<comp lib="0" loc="(330,400)" name="Splitter">
<a name="fanout" val="4"/>
<a name="incoming" val="16"/>
<a name="appear" val="center"/>
<a name="bit1" val="0"/>
<a name="bit2" val="0"/>
<a name="bit3" val="0"/>
<a name="bit4" val="1"/>
<a name="bit5" val="1"/>
<a name="bit6" val="1"/>
<a name="bit7" val="1"/>
<a name="bit8" val="2"/>
<a name="bit9" val="2"/>
<a name="bit10" val="2"/>
<a name="bit11" val="2"/>
<a name="bit12" val="3"/>
<a name="bit13" val="3"/>
<a name="bit14" val="3"/>
<a name="bit15" val="3"/>
</comp>
<comp lib="1" loc="(540,730)" name="AND Gate">
<a name="facing" val="north"/>
<a name="size" val="30"/>
<a name="inputs" val="2"/>
<a name="negate1" val="true"/>
</comp>
<comp lib="0" loc="(410,460)" name="Splitter">
<a name="facing" val="north"/>
<a name="incoming" val="8"/>
<a name="appear" val="center"/>
<a name="bit1" val="0"/>
<a name="bit2" val="0"/>
<a name="bit3" val="0"/>
<a name="bit4" val="1"/>
<a name="bit5" val="1"/>
<a name="bit6" val="1"/>
<a name="bit7" val="1"/>
</comp>
<comp lib="1" loc="(880,140)" name="NOR Gate">
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="5" loc="(790,50)" name="LED">
<a name="facing" val="south"/>
<a name="color" val="#ecf055"/>
<a name="label" val="ZF"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="6" loc="(975,227)" name="Text">
<a name="text" val="clock"/>
</comp>
<comp lib="6" loc="(1029,283)" name="Text">
<a name="text" val="Reg1"/>
</comp>
<comp lib="6" loc="(985,88)" name="Text">
<a name="text" val="by Davidson Francis"/>
</comp>
<comp lib="0" loc="(690,190)" name="Constant">
<a name="facing" val="west"/>
<a name="value" val="0x0"/>
</comp>
<comp lib="2" loc="(500,580)" name="Multiplexer">
<a name="facing" val="west"/>
<a name="width" val="16"/>
<a name="enable" val="false"/>
</comp>
<comp lib="0" loc="(470,70)" name="Probe">
<a name="radix" val="10unsigned"/>
<a name="label" val="RegBX"/>
</comp>
<comp lib="2" loc="(620,180)" name="Multiplexer">
<a name="facing" val="west"/>
<a name="select" val="2"/>
<a name="enable" val="false"/>
</comp>
<comp lib="2" loc="(320,120)" name="Multiplexer">
<a name="facing" val="west"/>
<a name="width" val="16"/>
<a name="enable" val="false"/>
</comp>
<comp loc="(360,590)" name="UControl"/>
<comp lib="6" loc="(944,429)" name="Text">
<a name="text" val="WriteBack"/>
</comp>
<comp lib="6" loc="(230,357)" name="Text">
<a name="text" val="Instruction memory"/>
</comp>
<comp lib="6" loc="(721,567)" name="Text">
<a name="text" val="aluOut"/>
</comp>
<comp lib="6" loc="(80,526)" name="Text">
<a name="text" val="powerOn"/>
</comp>
<comp lib="6" loc="(469,700)" name="Text">
<a name="text" val="immediatePresent"/>
</comp>
<comp lib="0" loc="(420,400)" name="Splitter">
<a name="incoming" val="4"/>
<a name="bit0" val="1"/>
<a name="bit2" val="0"/>
<a name="bit3" val="0"/>
</comp>
<comp lib="4" loc="(300,400)" name="RAM">
<a name="addrWidth" val="16"/>
<a name="dataWidth" val="16"/>
<a name="bus" val="separate"/>
</comp>
<comp lib="0" loc="(250,450)" name="Constant">
<a name="facing" val="north"/>
</comp>
<comp lib="0" loc="(470,50)" name="Probe">
<a name="radix" val="10unsigned"/>
<a name="label" val="RegCX"/>
</comp>
<comp lib="6" loc="(189,563)" name="Text">
<a name="text" val="jumpInstruction"/>
</comp>
<comp lib="0" loc="(60,330)" name="Pin">
<a name="tristate" val="false"/>
<a name="label" val="Reset"/>
<a name="labelloc" val="south"/>
</comp>
<comp loc="(620,400)" name="BRegs"/>
</circuit>
<circuit name="BRegs">
<a name="circuit" val="BRegs"/>
<a name="clabel" val=""/>
<a name="clabelup" val="east"/>
<a name="clabelfont" val="SansSerif plain 12"/>
<appear>
<rect fill="none" height="90" stroke="#000000" stroke-width="2" width="100" x="50" y="40"/>
<text font-family="SansSerif" font-size="12" text-anchor="middle" x="99" y="91">Bank</text>
<text font-family="SansSerif" font-size="12" text-anchor="middle" x="98" y="78">Registers</text>
<circ-port height="8" pin="100,230" width="8" x="66" y="126"/>
<circ-port height="8" pin="100,290" width="8" x="46" y="56"/>
<circ-port height="8" pin="100,400" width="8" x="46" y="96"/>
<circ-port height="8" pin="100,480" width="8" x="126" y="126"/>
<circ-port height="10" pin="780,300" width="10" x="145" y="75"/>
<circ-port height="8" pin="100,340" width="8" x="46" y="66"/>
<circ-port height="10" pin="780,520" width="10" x="145" y="85"/>
<circ-port height="10" pin="390,90" width="10" x="65" y="35"/>
<circ-port height="10" pin="520,90" width="10" x="85" y="35"/>
<circ-port height="10" pin="660,90" width="10" x="105" y="35"/>
<circ-port height="10" pin="790,90" width="10" x="125" y="35"/>
<circ-port height="8" pin="100,540" width="8" x="96" y="126"/>
<circ-anchor facing="east" height="6" width="6" x="147" y="77"/>
</appear>
<wire from="(390,110)" to="(580,110)"/>
<wire from="(740,320)" to="(740,460)"/>
<wire from="(260,320)" to="(260,460)"/>
<wire from="(100,230)" to="(280,230)"/>
<wire from="(250,560)" to="(740,560)"/>
<wire from="(500,250)" to="(500,330)"/>
<wire from="(500,170)" to="(500,250)"/>
<wire from="(500,330)" to="(500,410)"/>
<wire from="(570,200)" to="(570,280)"/>
<wire from="(570,280)" to="(570,360)"/>
<wire from="(570,360)" to="(570,440)"/>
<wire from="(490,330)" to="(490,360)"/>
<wire from="(500,140)" to="(500,170)"/>
<wire from="(490,250)" to="(490,280)"/>
<wire from="(490,410)" to="(490,440)"/>
<wire from="(490,170)" to="(490,200)"/>
<wire from="(740,540)" to="(740,560)"/>
<wire from="(250,340)" to="(250,560)"/>
<wire from="(100,290)" to="(260,290)"/>
<wire from="(690,250)" to="(690,290)"/>
<wire from="(260,460)" to="(740,460)"/>
<wire from="(540,200)" to="(570,200)"/>
<wire from="(540,280)" to="(570,280)"/>
<wire from="(540,360)" to="(570,360)"/>
<wire from="(540,440)" to="(570,440)"/>
<wire from="(550,170)" to="(580,170)"/>
<wire from="(500,250)" to="(520,250)"/>
<wire from="(500,170)" to="(520,170)"/>
<wire from="(500,410)" to="(520,410)"/>
<wire from="(500,330)" to="(520,330)"/>
<wire from="(370,160)" to="(370,270)"/>
<wire from="(100,340)" to="(250,340)"/>
<wire from="(650,520)" to="(720,520)"/>
<wire from="(280,130)" to="(420,130)"/>
<wire from="(260,320)" to="(340,320)"/>
<wire from="(710,310)" to="(720,310)"/>
<wire from="(370,160)" to="(440,160)"/>
<wire from="(370,400)" to="(440,400)"/>
<wire from="(290,140)" to="(290,400)"/>
<wire from="(540,190)" to="(540,200)"/>
<wire from="(540,270)" to="(540,280)"/>
<wire from="(540,350)" to="(540,360)"/>
<wire from="(540,430)" to="(540,440)"/>
<wire from="(610,110)" to="(790,110)"/>
<wire from="(100,540)" to="(160,540)"/>
<wire from="(600,330)" to="(650,330)"/>
<wire from="(390,320)" to="(440,320)"/>
<wire from="(390,240)" to="(440,240)"/>
<wire from="(520,90)" to="(520,100)"/>
<wire from="(310,280)" to="(310,290)"/>
<wire from="(340,310)" to="(340,320)"/>
<wire from="(550,250)" to="(590,250)"/>
<wire from="(670,170)" to="(710,170)"/>
<wire from="(690,300)" to="(690,330)"/>
<wire from="(420,340)" to="(420,420)"/>
<wire from="(420,260)" to="(420,340)"/>
<wire from="(420,180)" to="(420,260)"/>
<wire from="(590,100)" to="(590,250)"/>
<wire from="(760,520)" to="(780,520)"/>
<wire from="(660,250)" to="(690,250)"/>
<wire from="(420,420)" to="(440,420)"/>
<wire from="(420,340)" to="(440,340)"/>
<wire from="(420,260)" to="(440,260)"/>
<wire from="(420,180)" to="(440,180)"/>
<wire from="(100,480)" to="(570,480)"/>
<wire from="(390,240)" to="(390,280)"/>
<wire from="(710,310)" to="(710,410)"/>
<wire from="(600,100)" to="(600,330)"/>
<wire from="(580,110)" to="(580,170)"/>
<wire from="(710,280)" to="(720,280)"/>
<wire from="(530,190)" to="(530,200)"/>
<wire from="(530,270)" to="(530,280)"/>
<wire from="(530,350)" to="(530,360)"/>
<wire from="(530,430)" to="(530,440)"/>
<wire from="(550,330)" to="(600,330)"/>
<wire from="(660,510)" to="(720,510)"/>
<wire from="(100,400)" to="(150,400)"/>
<wire from="(390,90)" to="(390,110)"/>
<wire from="(390,290)" to="(390,320)"/>
<wire from="(790,90)" to="(790,110)"/>
<wire from="(490,200)" to="(530,200)"/>
<wire from="(490,280)" to="(530,280)"/>
<wire from="(490,360)" to="(530,360)"/>
<wire from="(490,440)" to="(530,440)"/>
<wire from="(280,130)" to="(280,230)"/>
<wire from="(370,300)" to="(370,400)"/>
<wire from="(610,110)" to="(610,410)"/>
<wire from="(360,280)" to="(390,280)"/>
<wire from="(690,290)" to="(720,290)"/>
<wire from="(290,140)" to="(500,140)"/>
<wire from="(610,410)" to="(640,410)"/>
<wire from="(580,170)" to="(670,170)"/>
<wire from="(640,410)" to="(640,530)"/>
<wire from="(310,290)" to="(320,290)"/>
<wire from="(640,410)" to="(710,410)"/>
<wire from="(360,300)" to="(370,300)"/>
<wire from="(650,330)" to="(650,520)"/>
<wire from="(670,170)" to="(670,500)"/>
<wire from="(660,90)" to="(660,100)"/>
<wire from="(670,500)" to="(720,500)"/>
<wire from="(550,410)" to="(610,410)"/>
<wire from="(600,100)" to="(660,100)"/>
<wire from="(660,250)" to="(660,510)"/>
<wire from="(180,400)" to="(290,400)"/>
<wire from="(650,330)" to="(690,330)"/>
<wire from="(260,290)" to="(260,320)"/>
<wire from="(570,440)" to="(570,480)"/>
<wire from="(710,170)" to="(710,280)"/>
<wire from="(360,290)" to="(390,290)"/>
<wire from="(760,300)" to="(780,300)"/>
<wire from="(690,300)" to="(720,300)"/>
<wire from="(470,170)" to="(490,170)"/>
<wire from="(470,250)" to="(490,250)"/>
<wire from="(470,330)" to="(490,330)"/>
<wire from="(470,410)" to="(490,410)"/>
<wire from="(360,270)" to="(370,270)"/>
<wire from="(590,250)" to="(660,250)"/>
<wire from="(420,130)" to="(420,180)"/>
<wire from="(640,530)" to="(720,530)"/>
<wire from="(160,420)" to="(160,540)"/>
<wire from="(520,100)" to="(590,100)"/>
<comp lib="0" loc="(100,400)" name="Pin">
<a name="width" val="16"/>
<a name="tristate" val="false"/>
<a name="label" val="DataIn"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="0" loc="(100,230)" name="Pin">
<a name="tristate" val="false"/>
<a name="label" val="R/W"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="0" loc="(660,90)" name="Pin">
<a name="facing" val="south"/>
<a name="output" val="true"/>
<a name="width" val="16"/>
<a name="tristate" val="false"/>
<a name="label" val="RegCOut"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="4" loc="(180,400)" name="Register">
<a name="width" val="16"/>
<a name="trigger" val="falling"/>
</comp>
<comp lib="0" loc="(780,520)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="width" val="16"/>
<a name="label" val="Reg2Out"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="0" loc="(520,90)" name="Pin">
<a name="facing" val="south"/>
<a name="output" val="true"/>
<a name="width" val="16"/>
<a name="tristate" val="false"/>
<a name="label" val="RegBOut"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="1" loc="(470,330)" name="AND Gate">
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="6" loc="(679,127)" name="Text">
<a name="text" val="&lt;--- just for Debug"/>
</comp>
<comp lib="0" loc="(780,300)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="width" val="16"/>
<a name="label" val="Reg1Out"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="0" loc="(100,480)" name="Pin">
<a name="tristate" val="false"/>
<a name="label" val="CLR"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="2" loc="(320,290)" name="Demultiplexer">
<a name="select" val="2"/>
<a name="enable" val="false"/>
</comp>
<comp lib="1" loc="(470,410)" name="AND Gate">
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="0" loc="(100,340)" name="Pin">
<a name="width" val="2"/>
<a name="tristate" val="false"/>
<a name="label" val="NReg2"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="0" loc="(100,540)" name="Pin">
<a name="tristate" val="false"/>
<a name="label" val="CLK"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="0" loc="(310,280)" name="Constant">
<a name="facing" val="south"/>
</comp>
<comp lib="0" loc="(790,90)" name="Pin">
<a name="facing" val="south"/>
<a name="output" val="true"/>
<a name="width" val="16"/>
<a name="tristate" val="false"/>
<a name="label" val="RegDOut"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="1" loc="(470,250)" name="AND Gate">
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="2" loc="(760,520)" name="Multiplexer">
<a name="select" val="2"/>
<a name="width" val="16"/>
<a name="enable" val="false"/>
</comp>
<comp lib="4" loc="(550,410)" name="Register">
<a name="width" val="16"/>
<a name="trigger" val="high"/>
<a name="label" val="RegDX"/>
</comp>
<comp lib="0" loc="(100,290)" name="Pin">
<a name="width" val="2"/>
<a name="tristate" val="false"/>
<a name="label" val="NReg1/Dest"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="0" loc="(390,90)" name="Pin">
<a name="facing" val="south"/>
<a name="output" val="true"/>
<a name="width" val="16"/>
<a name="tristate" val="false"/>
<a name="label" val="RegAOut"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="4" loc="(550,330)" name="Register">
<a name="width" val="16"/>
<a name="trigger" val="high"/>
<a name="label" val="RegCX"/>
</comp>
<comp lib="4" loc="(550,250)" name="Register">
<a name="width" val="16"/>
<a name="trigger" val="high"/>
<a name="label" val="RegBX"/>
</comp>
<comp lib="2" loc="(760,300)" name="Multiplexer">
<a name="select" val="2"/>
<a name="width" val="16"/>
<a name="enable" val="false"/>
</comp>
<comp lib="1" loc="(470,170)" name="AND Gate">
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="4" loc="(550,170)" name="Register">
<a name="width" val="16"/>
<a name="trigger" val="high"/>
<a name="label" val="RegAX"/>
</comp>
</circuit>
<circuit name="UControl">
<a name="circuit" val="UControl"/>
<a name="clabel" val=""/>
<a name="clabelup" val="east"/>
<a name="clabelfont" val="SansSerif plain 12"/>
<appear>
<rect fill="none" height="21" stroke="#f0b25b" stroke-width="3" width="129" x="50" y="50"/>
<text font-family="SansSerif" font-size="12" text-anchor="middle" x="108" y="64">U. Controle</text>
<circ-port height="10" pin="470,280" width="10" x="65" y="65"/>
<circ-port height="10" pin="470,390" width="10" x="105" y="65"/>
<circ-port height="10" pin="470,720" width="10" x="125" y="65"/>
<circ-port height="10" pin="470,800" width="10" x="145" y="65"/>
<circ-port height="8" pin="80,100" width="8" x="46" y="56"/>
<circ-port height="10" pin="470,570" width="10" x="175" y="55"/>
<circ-port height="10" pin="470,870" width="10" x="65" y="45"/>
<circ-port height="10" pin="470,190" width="10" x="85" y="65"/>
<circ-port height="10" pin="470,640" width="10" x="145" y="45"/>
<circ-anchor facing="east" height="6" width="6" x="67" y="67"/>
</appear>
<wire from="(60,810)" to="(120,810)"/>
<wire from="(60,730)" to="(120,730)"/>
<wire from="(70,860)" to="(130,860)"/>
<wire from="(60,250)" to="(60,320)"/>
<wire from="(60,810)" to="(60,880)"/>
<wire from="(80,630)" to="(80,700)"/>
<wire from="(50,820)" to="(50,890)"/>
<wire from="(70,640)" to="(70,710)"/>
<wire from="(40,450)" to="(220,450)"/>
<wire from="(60,320)" to="(110,320)"/>
<wire from="(80,780)" to="(130,780)"/>
<wire from="(60,730)" to="(60,810)"/>
<wire from="(50,740)" to="(50,820)"/>
<wire from="(170,550)" to="(340,550)"/>
<wire from="(170,280)" to="(470,280)"/>
<wire from="(200,340)" to="(200,360)"/>
<wire from="(280,460)" to="(380,460)"/>
<wire from="(240,190)" to="(470,190)"/>
<wire from="(300,400)" to="(300,430)"/>
<wire from="(300,590)" to="(340,590)"/>
<wire from="(180,720)" to="(470,720)"/>
<wire from="(280,460)" to="(280,870)"/>
<wire from="(130,230)" to="(160,230)"/>
<wire from="(130,150)" to="(160,150)"/>
<wire from="(130,170)" to="(160,170)"/>
<wire from="(130,210)" to="(160,210)"/>
<wire from="(70,250)" to="(70,410)"/>
<wire from="(80,630)" to="(240,630)"/>
<wire from="(80,220)" to="(110,220)"/>
<wire from="(50,340)" to="(50,440)"/>
<wire from="(200,380)" to="(200,800)"/>
<wire from="(280,430)" to="(300,430)"/>
<wire from="(80,100)" to="(80,140)"/>
<wire from="(40,360)" to="(120,360)"/>
<wire from="(50,890)" to="(130,890)"/>
<wire from="(200,800)" to="(470,800)"/>
<wire from="(200,380)" to="(210,380)"/>
<wire from="(40,740)" to="(50,740)"/>
<wire from="(70,630)" to="(80,630)"/>
<wire from="(50,730)" to="(60,730)"/>
<wire from="(60,640)" to="(70,640)"/>
<wire from="(380,400)" to="(380,460)"/>
<wire from="(50,340)" to="(120,340)"/>
<wire from="(80,160)" to="(80,220)"/>
<wire from="(70,790)" to="(130,790)"/>
<wire from="(70,710)" to="(130,710)"/>
<wire from="(60,160)" to="(60,230)"/>
<wire from="(280,870)" to="(470,870)"/>
<wire from="(70,790)" to="(70,860)"/>
<wire from="(80,780)" to="(80,850)"/>
<wire from="(270,360)" to="(320,360)"/>
<wire from="(90,160)" to="(90,170)"/>
<wire from="(80,850)" to="(130,850)"/>
<wire from="(40,280)" to="(40,360)"/>
<wire from="(70,710)" to="(70,790)"/>
<wire from="(80,700)" to="(80,780)"/>
<wire from="(40,280)" to="(150,280)"/>
<wire from="(50,440)" to="(220,440)"/>
<wire from="(70,640)" to="(240,640)"/>
<wire from="(80,700)" to="(120,700)"/>
<wire from="(50,250)" to="(50,340)"/>
<wire from="(40,360)" to="(40,450)"/>
<wire from="(70,410)" to="(70,630)"/>
<wire from="(60,420)" to="(60,640)"/>
<wire from="(40,250)" to="(40,280)"/>
<wire from="(430,390)" to="(470,390)"/>
<wire from="(130,160)" to="(160,160)"/>
<wire from="(130,200)" to="(160,200)"/>
<wire from="(170,360)" to="(200,360)"/>
<wire from="(130,180)" to="(160,180)"/>
<wire from="(130,220)" to="(160,220)"/>
<wire from="(60,420)" to="(220,420)"/>
<wire from="(40,450)" to="(40,740)"/>
<wire from="(50,440)" to="(50,730)"/>
<wire from="(440,570)" to="(470,570)"/>
<wire from="(300,430)" to="(300,590)"/>
<wire from="(60,320)" to="(60,420)"/>
<wire from="(190,870)" to="(280,870)"/>
<wire from="(370,380)" to="(400,380)"/>
<wire from="(300,400)" to="(320,400)"/>
<wire from="(370,550)" to="(390,550)"/>
<wire from="(370,590)" to="(390,590)"/>
<wire from="(380,400)" to="(400,400)"/>
<wire from="(260,640)" to="(470,640)"/>
<wire from="(90,170)" to="(110,170)"/>
<wire from="(180,340)" to="(200,340)"/>
<wire from="(200,340)" to="(220,340)"/>
<wire from="(180,800)" to="(200,800)"/>
<wire from="(50,740)" to="(130,740)"/>
<wire from="(50,820)" to="(130,820)"/>
<wire from="(70,410)" to="(210,410)"/>
<wire from="(60,880)" to="(130,880)"/>
<wire from="(170,360)" to="(170,550)"/>
<comp lib="0" loc="(80,100)" name="Pin">
<a name="facing" val="south"/>
<a name="width" val="16"/>
<a name="tristate" val="false"/>
<a name="label" val="Instruction"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="0" loc="(470,570)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="label" val="Jump"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="0" loc="(470,870)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="label" val="PowerOn"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="0" loc="(110,220)" name="Splitter">
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="legacy"/>
</comp>
<comp lib="0" loc="(80,140)" name="Splitter">
<a name="facing" val="south"/>
<a name="fanout" val="4"/>
<a name="incoming" val="16"/>
<a name="appear" val="center"/>
<a name="bit1" val="0"/>
<a name="bit2" val="0"/>
<a name="bit3" val="0"/>
<a name="bit4" val="1"/>
<a name="bit5" val="1"/>
<a name="bit6" val="1"/>
<a name="bit7" val="1"/>
<a name="bit8" val="2"/>
<a name="bit9" val="2"/>
<a name="bit10" val="2"/>
<a name="bit11" val="2"/>
<a name="bit12" val="3"/>
<a name="bit13" val="3"/>
<a name="bit14" val="3"/>
<a name="bit15" val="3"/>
</comp>
<comp lib="1" loc="(430,390)" name="AND Gate">
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="1" loc="(440,570)" name="OR Gate">
<a name="inputs" val="2"/>
</comp>
<comp lib="1" loc="(370,380)" name="AND Gate">
<a name="inputs" val="2"/>
</comp>
<comp lib="1" loc="(240,190)" name="NAND Gate">
<a name="size" val="70"/>
<a name="inputs" val="8"/>
</comp>
<comp lib="1" loc="(280,430)" name="NAND Gate">
<a name="inputs" val="4"/>
<a name="negate0" val="true"/>
</comp>
<comp lib="0" loc="(60,230)" name="Splitter">
<a name="facing" val="south"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="center"/>
</comp>
<comp lib="0" loc="(470,800)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="label" val="L = 0 / S = 1"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="0" loc="(110,170)" name="Splitter">
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="legacy"/>
</comp>
<comp lib="1" loc="(370,590)" name="NOT Gate"/>
<comp lib="0" loc="(470,280)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="label" val="setFlag"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="1" loc="(180,800)" name="AND Gate">
<a name="inputs" val="4"/>
<a name="negate2" val="true"/>
</comp>
<comp lib="1" loc="(370,550)" name="NOT Gate"/>
<comp lib="1" loc="(270,360)" name="AND Gate">
<a name="inputs" val="2"/>
<a name="negate1" val="true"/>
</comp>
<comp lib="1" loc="(190,870)" name="NAND Gate"/>
<comp lib="0" loc="(470,190)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="label" val="immPresent"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="6" loc="(714,398)" name="Text">
<a name="text" val="&lt;--Store, JUMPZ, JUMPN, JUMPP and HALT don't have WB"/>
</comp>
<comp lib="0" loc="(470,720)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="label" val="Mem = 1/ALU = 0"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="1" loc="(180,340)" name="NAND Gate">
<a name="inputs" val="3"/>
<a name="negate0" val="true"/>
</comp>
<comp lib="0" loc="(470,390)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="label" val="WB"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="1" loc="(180,720)" name="AND Gate">
<a name="inputs" val="4"/>
<a name="negate0" val="true"/>
<a name="negate2" val="true"/>
</comp>
<comp lib="0" loc="(260,640)" name="Splitter">
<a name="facing" val="west"/>
<a name="appear" val="legacy"/>
</comp>
<comp lib="1" loc="(170,280)" name="NOT Gate">
<a name="size" val="20"/>
</comp>
<comp lib="0" loc="(470,640)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="width" val="2"/>
<a name="label" val="selJump"/>
<a name="labelloc" val="east"/>
</comp>
</circuit>
<circuit name="ALU">
<a name="circuit" val="ALU"/>
<a name="clabel" val=""/>
<a name="clabelup" val="east"/>
<a name="clabelfont" val="SansSerif plain 12"/>
<appear>
<path d="M51,54 Q55,51 51,47" fill="none" stroke="#808080" stroke-width="2"/>
<polyline fill="none" points="50,21 50,110" stroke="#686bc4" stroke-width="3"/>
<polyline fill="none" points="51,112 59,121" stroke="#686bc4" stroke-width="3"/>
<polyline fill="none" points="59,121 50,131" stroke="#686bc4" stroke-width="3"/>
<polyline fill="none" points="50,131 50,208" stroke="#686bc4" stroke-width="3"/>
<polyline fill="none" points="51,21 130,99" stroke="#686bc4" stroke-width="3"/>
<polyline fill="none" points="52,208 130,163" stroke="#686bc4" stroke-width="3"/>
<polyline fill="none" points="130,100 130,161" stroke="#686bc4" stroke-width="3"/>
<text font-family="SansSerif" font-size="12" text-anchor="middle" x="90" y="105">Arithmetic</text>
<text font-family="SansSerif" font-size="12" text-anchor="middle" x="87" y="137">Unit</text>
<text font-family="SansSerif" font-size="12" text-anchor="middle" x="88" y="120">Logic</text>
<circ-port height="8" pin="100,200" width="8" x="46" y="106"/>
<circ-port height="8" pin="100,310" width="8" x="46" y="126"/>
<circ-port height="8" pin="100,580" width="8" x="46" y="46"/>
<circ-port height="8" pin="100,600" width="8" x="46" y="56"/>
<circ-port height="10" pin="350,590" width="10" x="65" y="35"/>
<circ-port height="8" pin="430,460" width="8" x="96" y="176"/>
<circ-port height="8" pin="550,650" width="8" x="46" y="176"/>
<circ-port height="10" pin="650,650" width="10" x="95" y="65"/>
<circ-port height="10" pin="750,650" width="10" x="105" y="75"/>
<circ-port height="10" pin="740,380" width="10" x="125" y="125"/>
<circ-anchor facing="east" height="6" width="6" x="67" y="37"/>
</appear>
<wire from="(620,580)" to="(620,590)"/>
<wire from="(160,390)" to="(160,460)"/>
<wire from="(140,370)" to="(140,440)"/>
<wire from="(500,340)" to="(690,340)"/>
<wire from="(140,170)" to="(200,170)"/>
<wire from="(140,370)" to="(200,370)"/>
<wire from="(350,90)" to="(350,230)"/>
<wire from="(670,380)" to="(670,450)"/>
<wire from="(380,340)" to="(380,350)"/>
<wire from="(380,300)" to="(380,310)"/>
<wire from="(320,240)" to="(320,260)"/>
<wire from="(650,560)" to="(650,650)"/>
<wire from="(510,430)" to="(510,450)"/>
<wire from="(690,340)" to="(690,560)"/>
<wire from="(430,380)" to="(430,460)"/>
<wire from="(540,370)" to="(540,450)"/>
<wire from="(580,370)" to="(580,450)"/>
<wire from="(160,250)" to="(200,250)"/>
<wire from="(650,370)" to="(650,390)"/>
<wire from="(350,290)" to="(350,450)"/>
<wire from="(690,560)" to="(710,560)"/>
<wire from="(380,320)" to="(410,320)"/>
<wire from="(380,360)" to="(410,360)"/>
<wire from="(340,130)" to="(340,240)"/>
<wire from="(450,300)" to="(590,300)"/>
<wire from="(550,590)" to="(550,650)"/>
<wire from="(330,270)" to="(410,270)"/>
<wire from="(610,370)" to="(610,430)"/>
<wire from="(660,380)" to="(670,380)"/>
<wire from="(600,440)" to="(610,440)"/>
<wire from="(620,420)" to="(630,420)"/>
<wire from="(640,400)" to="(650,400)"/>
<wire from="(640,560)" to="(650,560)"/>
<wire from="(350,230)" to="(410,230)"/>
<wire from="(160,320)" to="(160,390)"/>
<wire from="(140,300)" to="(140,370)"/>
<wire from="(140,300)" to="(200,300)"/>
<wire from="(160,530)" to="(210,530)"/>
<wire from="(380,350)" to="(380,360)"/>
<wire from="(620,590)" to="(720,590)"/>
<wire from="(640,370)" to="(640,400)"/>
<wire from="(530,370)" to="(530,450)"/>
<wire from="(570,370)" to="(570,450)"/>
<wire from="(100,200)" to="(140,200)"/>
<wire from="(360,300)" to="(360,520)"/>
<wire from="(160,460)" to="(200,460)"/>
<wire from="(620,430)" to="(620,450)"/>
<wire from="(500,340)" to="(500,430)"/>
<wire from="(240,130)" to="(340,130)"/>
<wire from="(640,410)" to="(640,450)"/>
<wire from="(320,260)" to="(410,260)"/>
<wire from="(240,180)" to="(330,180)"/>
<wire from="(380,330)" to="(410,330)"/>
<wire from="(380,370)" to="(410,370)"/>
<wire from="(500,430)" to="(510,430)"/>
<wire from="(140,90)" to="(220,90)"/>
<wire from="(550,590)" to="(620,590)"/>
<wire from="(660,390)" to="(660,450)"/>
<wire from="(730,380)" to="(740,380)"/>
<wire from="(160,250)" to="(160,310)"/>
<wire from="(720,580)" to="(720,590)"/>
<wire from="(330,180)" to="(330,250)"/>
<wire from="(140,230)" to="(140,300)"/>
<wire from="(100,310)" to="(160,310)"/>
<wire from="(140,230)" to="(200,230)"/>
<wire from="(360,220)" to="(410,220)"/>
<wire from="(240,520)" to="(360,520)"/>
<wire from="(160,140)" to="(210,140)"/>
<wire from="(160,60)" to="(210,60)"/>
<wire from="(600,370)" to="(600,440)"/>
<wire from="(380,320)" to="(380,330)"/>
<wire from="(380,360)" to="(380,370)"/>
<wire from="(240,90)" to="(350,90)"/>
<wire from="(240,450)" to="(350,450)"/>
<wire from="(750,560)" to="(750,650)"/>
<wire from="(590,530)" to="(590,560)"/>
<wire from="(520,370)" to="(520,450)"/>
<wire from="(560,370)" to="(560,450)"/>
<wire from="(160,390)" to="(200,390)"/>
<wire from="(160,190)" to="(200,190)"/>
<wire from="(730,300)" to="(730,380)"/>
<wire from="(140,200)" to="(140,230)"/>
<wire from="(240,380)" to="(340,380)"/>
<wire from="(630,370)" to="(630,410)"/>
<wire from="(240,310)" to="(330,310)"/>
<wire from="(590,560)" to="(610,560)"/>
<wire from="(380,340)" to="(410,340)"/>
<wire from="(380,300)" to="(410,300)"/>
<wire from="(330,270)" to="(330,310)"/>
<wire from="(160,140)" to="(160,190)"/>
<wire from="(140,120)" to="(140,170)"/>
<wire from="(140,40)" to="(140,90)"/>
<wire from="(100,580)" to="(180,580)"/>
<wire from="(240,240)" to="(320,240)"/>
<wire from="(330,250)" to="(410,250)"/>
<wire from="(510,370)" to="(510,430)"/>
<wire from="(650,390)" to="(660,390)"/>
<wire from="(740,560)" to="(750,560)"/>
<wire from="(590,300)" to="(730,300)"/>
<wire from="(590,450)" to="(600,450)"/>
<wire from="(610,430)" to="(620,430)"/>
<wire from="(630,410)" to="(640,410)"/>
<wire from="(290,590)" to="(350,590)"/>
<wire from="(660,370)" to="(660,380)"/>
<wire from="(350,290)" to="(410,290)"/>
<wire from="(610,440)" to="(610,450)"/>
<wire from="(160,460)" to="(160,530)"/>
<wire from="(140,440)" to="(200,440)"/>
<wire from="(200,580)" to="(260,580)"/>
<wire from="(160,310)" to="(160,320)"/>
<wire from="(240,50)" to="(360,50)"/>
<wire from="(380,330)" to="(380,340)"/>
<wire from="(380,370)" to="(380,380)"/>
<wire from="(160,60)" to="(160,140)"/>
<wire from="(630,420)" to="(630,450)"/>
<wire from="(550,370)" to="(550,450)"/>
<wire from="(590,370)" to="(590,450)"/>
<wire from="(160,320)" to="(200,320)"/>
<wire from="(140,90)" to="(140,120)"/>
<wire from="(140,170)" to="(140,200)"/>
<wire from="(340,280)" to="(340,380)"/>
<wire from="(100,600)" to="(260,600)"/>
<wire from="(380,350)" to="(410,350)"/>
<wire from="(380,310)" to="(410,310)"/>
<wire from="(360,300)" to="(380,300)"/>
<wire from="(360,50)" to="(360,220)"/>
<wire from="(200,510)" to="(210,510)"/>
<wire from="(140,120)" to="(210,120)"/>
<wire from="(140,40)" to="(210,40)"/>
<wire from="(650,400)" to="(650,450)"/>
<wire from="(620,370)" to="(620,420)"/>
<wire from="(590,300)" to="(590,350)"/>
<wire from="(160,190)" to="(160,250)"/>
<wire from="(340,280)" to="(410,280)"/>
<wire from="(340,240)" to="(410,240)"/>
<comp lib="0" loc="(550,650)" name="Pin">
<a name="facing" val="north"/>
<a name="tristate" val="false"/>
<a name="label" val="setFlag"/>
<a name="labelloc" val="south"/>
</comp>
<comp lib="1" loc="(240,130)" name="AND Gate">
<a name="width" val="16"/>
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="3" loc="(240,240)" name="Adder">
<a name="width" val="16"/>
</comp>
<comp lib="4" loc="(640,560)" name="Register">
<a name="width" val="1"/>
<a name="label" val="ZF"/>
</comp>
<comp lib="0" loc="(100,600)" name="Pin">
<a name="tristate" val="false"/>
<a name="label" val="WB"/>
</comp>
<comp lib="6" loc="(187,634)" name="Text">
<a name="text" val="^--- write signal in registers bank"/>
</comp>
<comp lib="1" loc="(240,180)" name="XOR Gate">
<a name="width" val="16"/>
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="3" loc="(240,450)" name="Divider">
<a name="width" val="16"/>
</comp>
<comp lib="0" loc="(200,510)" name="Constant">
<a name="width" val="16"/>
<a name="value" val="0x0"/>
</comp>
<comp lib="1" loc="(240,50)" name="OR Gate">
<a name="width" val="16"/>
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="2" loc="(450,300)" name="Multiplexer">
<a name="select" val="4"/>
<a name="width" val="16"/>
<a name="enable" val="false"/>
</comp>
<comp lib="0" loc="(750,650)" name="Pin">
<a name="facing" val="north"/>
<a name="output" val="true"/>
<a name="label" val="NF"/>
<a name="labelloc" val="south"/>
</comp>
<comp lib="0" loc="(430,460)" name="Pin">
<a name="facing" val="north"/>
<a name="width" val="4"/>
<a name="tristate" val="false"/>
<a name="label" val="opSelector"/>
<a name="labelloc" val="south"/>
</comp>
<comp lib="3" loc="(240,380)" name="Multiplier">
<a name="width" val="16"/>
</comp>
<comp lib="0" loc="(100,200)" name="Pin">
<a name="width" val="16"/>
<a name="tristate" val="false"/>
<a name="label" val="Op1"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="3" loc="(240,310)" name="Subtractor">
<a name="width" val="16"/>
</comp>
<comp lib="6" loc="(169,651)" name="Text">
<a name="text" val="in the falling edge."/>
</comp>
<comp lib="6" loc="(299,517)" name="Text">
<a name="text" val="8 - 9: MOV"/>
</comp>
<comp lib="1" loc="(200,580)" name="NOT Gate">
<a name="size" val="20"/>
</comp>
<comp lib="0" loc="(380,380)" name="Constant">
<a name="facing" val="north"/>
<a name="width" val="16"/>
<a name="value" val="0x0"/>
</comp>
<comp lib="1" loc="(590,530)" name="NOR Gate">
<a name="facing" val="south"/>
<a name="size" val="70"/>
<a name="inputs" val="16"/>
</comp>
<comp lib="0" loc="(650,650)" name="Pin">
<a name="facing" val="north"/>
<a name="output" val="true"/>
<a name="label" val="ZF"/>
<a name="labelloc" val="south"/>
</comp>
<comp lib="0" loc="(740,380)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="width" val="16"/>
<a name="label" val="OutputALU"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="1" loc="(240,520)" name="OR Gate">
<a name="width" val="16"/>
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="0" loc="(350,590)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="label" val="setRegister"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="1" loc="(290,590)" name="AND Gate">
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="0" loc="(590,350)" name="Splitter">
<a name="facing" val="south"/>
<a name="fanout" val="16"/>
<a name="incoming" val="16"/>
<a name="appear" val="legacy"/>
</comp>
<comp lib="4" loc="(740,560)" name="Register">
<a name="width" val="1"/>
<a name="label" val="NF"/>
</comp>
<comp lib="0" loc="(100,310)" name="Pin">
<a name="width" val="16"/>
<a name="tristate" val="false"/>
<a name="label" val="Op2"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="1" loc="(240,90)" name="NOT Gate">
<a name="width" val="16"/>
<a name="size" val="20"/>
</comp>
<comp lib="0" loc="(100,580)" name="Pin">
<a name="tristate" val="false"/>
<a name="label" val="clkIn"/>
</comp>
</circuit>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment