changes
This commit is contained in:
parent
2720c24118
commit
8e189b27c4
44
cpu 3/asm.rb
Normal file
44
cpu 3/asm.rb
Normal file
@ -0,0 +1,44 @@
|
||||
def store?(char)
|
||||
if char == "s"
|
||||
return 0
|
||||
elsif char == "S"
|
||||
return 1
|
||||
end
|
||||
throw("No valid character detected")
|
||||
end
|
||||
def jump?(char)
|
||||
if char == "j"
|
||||
return 0
|
||||
elsif char == "J"
|
||||
return 1
|
||||
end
|
||||
throw("No valid character detected")
|
||||
end
|
||||
|
||||
Isel={"M"=>0,"I"=>1,"R"=>10}
|
||||
Osel={"+"=>0,"-"=>1,"="=>10,"H"=>11}
|
||||
puts "File:"
|
||||
inFile = gets.chomp
|
||||
unless inFile.include?(".asm")
|
||||
inFile+=".asm"
|
||||
end
|
||||
|
||||
outFile = inFile.gsub(".asm",".code")
|
||||
outFile = File.open(outFile,"w")
|
||||
File.open(inFile,"r") do |f|
|
||||
outFile.puts "v2.0 raw"
|
||||
f.each_line do |line|
|
||||
line = line.split(" ")
|
||||
bina = Isel[line[0]].to_s.rjust(2, "0")
|
||||
binb = Isel[line[1]].to_s.rjust(2, "0")
|
||||
bino = Osel[line[2]].to_s.rjust(2, "0")
|
||||
store = store?(line[3]).to_s
|
||||
jump = jump?(line[4]).to_s
|
||||
addr = line[5]
|
||||
op = jump + store + bino + binb + bina
|
||||
op = op.to_i(2).to_s(16).rjust(2, "0")
|
||||
op += addr
|
||||
outFile.puts op
|
||||
end
|
||||
end
|
||||
outFile.close
|
460
cpu 3/cpu.circ
Normal file
460
cpu 3/cpu.circ
Normal file
@ -0,0 +1,460 @@
|
||||
<?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"/>
|
||||
<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="main"/>
|
||||
<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="Ctrl Button1" name="Menu Tool"/>
|
||||
<tool lib="6" map="Button3" 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">
|
||||
<a name="size" val="30"/>
|
||||
<a name="inputs" val="2"/>
|
||||
</tool>
|
||||
<tool lib="1" name="OR Gate"/>
|
||||
</toolbar>
|
||||
<circuit name="main">
|
||||
<a name="circuit" val="main"/>
|
||||
<a name="clabel" val=""/>
|
||||
<a name="clabelup" val="east"/>
|
||||
<a name="clabelfont" val="SansSerif plain 12"/>
|
||||
<wire from="(710,550)" to="(760,550)"/>
|
||||
<wire from="(840,500)" to="(890,500)"/>
|
||||
<wire from="(340,380)" to="(340,780)"/>
|
||||
<wire from="(150,550)" to="(200,550)"/>
|
||||
<wire from="(120,360)" to="(120,370)"/>
|
||||
<wire from="(800,560)" to="(810,560)"/>
|
||||
<wire from="(60,270)" to="(60,370)"/>
|
||||
<wire from="(160,390)" to="(160,410)"/>
|
||||
<wire from="(630,580)" to="(660,580)"/>
|
||||
<wire from="(40,470)" to="(140,470)"/>
|
||||
<wire from="(720,560)" to="(760,560)"/>
|
||||
<wire from="(560,520)" to="(570,520)"/>
|
||||
<wire from="(780,340)" to="(870,340)"/>
|
||||
<wire from="(160,150)" to="(180,150)"/>
|
||||
<wire from="(470,510)" to="(500,510)"/>
|
||||
<wire from="(490,460)" to="(490,500)"/>
|
||||
<wire from="(480,470)" to="(850,470)"/>
|
||||
<wire from="(610,560)" to="(680,560)"/>
|
||||
<wire from="(490,570)" to="(500,570)"/>
|
||||
<wire from="(270,520)" to="(310,520)"/>
|
||||
<wire from="(870,540)" to="(870,550)"/>
|
||||
<wire from="(700,590)" to="(710,590)"/>
|
||||
<wire from="(310,390)" to="(510,390)"/>
|
||||
<wire from="(100,500)" to="(140,500)"/>
|
||||
<wire from="(310,390)" to="(310,520)"/>
|
||||
<wire from="(120,360)" to="(130,360)"/>
|
||||
<wire from="(10,230)" to="(170,230)"/>
|
||||
<wire from="(730,380)" to="(840,380)"/>
|
||||
<wire from="(570,630)" to="(720,630)"/>
|
||||
<wire from="(710,530)" to="(710,540)"/>
|
||||
<wire from="(70,530)" to="(80,530)"/>
|
||||
<wire from="(740,400)" to="(740,590)"/>
|
||||
<wire from="(160,380)" to="(160,390)"/>
|
||||
<wire from="(480,770)" to="(480,800)"/>
|
||||
<wire from="(340,780)" to="(380,780)"/>
|
||||
<wire from="(490,500)" to="(490,570)"/>
|
||||
<wire from="(150,460)" to="(150,550)"/>
|
||||
<wire from="(310,760)" to="(520,760)"/>
|
||||
<wire from="(420,320)" to="(420,470)"/>
|
||||
<wire from="(640,590)" to="(640,600)"/>
|
||||
<wire from="(800,570)" to="(810,570)"/>
|
||||
<wire from="(470,380)" to="(490,380)"/>
|
||||
<wire from="(630,520)" to="(660,520)"/>
|
||||
<wire from="(980,410)" to="(980,550)"/>
|
||||
<wire from="(10,410)" to="(160,410)"/>
|
||||
<wire from="(200,520)" to="(200,550)"/>
|
||||
<wire from="(230,870)" to="(380,870)"/>
|
||||
<wire from="(450,550)" to="(450,750)"/>
|
||||
<wire from="(140,420)" to="(170,420)"/>
|
||||
<wire from="(740,400)" to="(810,400)"/>
|
||||
<wire from="(540,520)" to="(560,520)"/>
|
||||
<wire from="(870,340)" to="(870,490)"/>
|
||||
<wire from="(430,330)" to="(440,330)"/>
|
||||
<wire from="(310,660)" to="(820,660)"/>
|
||||
<wire from="(510,370)" to="(510,390)"/>
|
||||
<wire from="(150,440)" to="(150,460)"/>
|
||||
<wire from="(870,490)" to="(890,490)"/>
|
||||
<wire from="(10,420)" to="(10,660)"/>
|
||||
<wire from="(310,520)" to="(310,660)"/>
|
||||
<wire from="(0,380)" to="(100,380)"/>
|
||||
<wire from="(800,570)" to="(800,610)"/>
|
||||
<wire from="(570,550)" to="(630,550)"/>
|
||||
<wire from="(470,580)" to="(500,580)"/>
|
||||
<wire from="(700,530)" to="(710,530)"/>
|
||||
<wire from="(540,590)" to="(560,590)"/>
|
||||
<wire from="(470,510)" to="(470,580)"/>
|
||||
<wire from="(610,360)" to="(610,560)"/>
|
||||
<wire from="(140,470)" to="(140,500)"/>
|
||||
<wire from="(920,410)" to="(980,410)"/>
|
||||
<wire from="(310,750)" to="(450,750)"/>
|
||||
<wire from="(600,480)" to="(620,480)"/>
|
||||
<wire from="(60,460)" to="(150,460)"/>
|
||||
<wire from="(720,560)" to="(720,630)"/>
|
||||
<wire from="(200,170)" to="(200,270)"/>
|
||||
<wire from="(480,520)" to="(480,590)"/>
|
||||
<wire from="(470,470)" to="(470,510)"/>
|
||||
<wire from="(800,610)" to="(860,610)"/>
|
||||
<wire from="(840,410)" to="(890,410)"/>
|
||||
<wire from="(290,330)" to="(290,800)"/>
|
||||
<wire from="(800,500)" to="(800,560)"/>
|
||||
<wire from="(480,520)" to="(500,520)"/>
|
||||
<wire from="(310,770)" to="(480,770)"/>
|
||||
<wire from="(520,540)" to="(520,550)"/>
|
||||
<wire from="(340,380)" to="(470,380)"/>
|
||||
<wire from="(480,590)" to="(500,590)"/>
|
||||
<wire from="(800,500)" to="(810,500)"/>
|
||||
<wire from="(420,850)" to="(800,850)"/>
|
||||
<wire from="(220,380)" to="(220,390)"/>
|
||||
<wire from="(450,550)" to="(520,550)"/>
|
||||
<wire from="(380,870)" to="(610,870)"/>
|
||||
<wire from="(310,780)" to="(340,780)"/>
|
||||
<wire from="(230,530)" to="(230,870)"/>
|
||||
<wire from="(580,330)" to="(600,330)"/>
|
||||
<wire from="(10,660)" to="(310,660)"/>
|
||||
<wire from="(160,170)" to="(170,170)"/>
|
||||
<wire from="(170,190)" to="(170,230)"/>
|
||||
<wire from="(140,420)" to="(140,470)"/>
|
||||
<wire from="(80,520)" to="(80,530)"/>
|
||||
<wire from="(200,380)" to="(200,430)"/>
|
||||
<wire from="(70,570)" to="(190,570)"/>
|
||||
<wire from="(780,590)" to="(780,770)"/>
|
||||
<wire from="(570,520)" to="(570,550)"/>
|
||||
<wire from="(710,350)" to="(720,350)"/>
|
||||
<wire from="(860,520)" to="(870,520)"/>
|
||||
<wire from="(680,550)" to="(680,560)"/>
|
||||
<wire from="(420,790)" to="(420,850)"/>
|
||||
<wire from="(740,590)" to="(780,590)"/>
|
||||
<wire from="(620,370)" to="(620,480)"/>
|
||||
<wire from="(480,470)" to="(480,520)"/>
|
||||
<wire from="(800,460)" to="(800,500)"/>
|
||||
<wire from="(900,520)" to="(900,530)"/>
|
||||
<wire from="(490,460)" to="(600,460)"/>
|
||||
<wire from="(60,450)" to="(60,460)"/>
|
||||
<wire from="(40,440)" to="(40,470)"/>
|
||||
<wire from="(780,580)" to="(780,590)"/>
|
||||
<wire from="(420,320)" to="(430,320)"/>
|
||||
<wire from="(160,190)" to="(170,190)"/>
|
||||
<wire from="(150,440)" to="(170,440)"/>
|
||||
<wire from="(190,670)" to="(830,670)"/>
|
||||
<wire from="(60,270)" to="(200,270)"/>
|
||||
<wire from="(870,550)" to="(980,550)"/>
|
||||
<wire from="(380,800)" to="(380,870)"/>
|
||||
<wire from="(530,370)" to="(530,380)"/>
|
||||
<wire from="(600,480)" to="(600,620)"/>
|
||||
<wire from="(90,360)" to="(90,430)"/>
|
||||
<wire from="(40,440)" to="(50,440)"/>
|
||||
<wire from="(290,320)" to="(420,320)"/>
|
||||
<wire from="(680,610)" to="(680,620)"/>
|
||||
<wire from="(600,620)" to="(680,620)"/>
|
||||
<wire from="(520,610)" to="(520,760)"/>
|
||||
<wire from="(560,590)" to="(640,590)"/>
|
||||
<wire from="(620,370)" to="(720,370)"/>
|
||||
<wire from="(810,400)" to="(810,420)"/>
|
||||
<wire from="(800,610)" to="(800,850)"/>
|
||||
<wire from="(850,470)" to="(850,560)"/>
|
||||
<wire from="(900,520)" to="(910,520)"/>
|
||||
<wire from="(0,670)" to="(190,670)"/>
|
||||
<wire from="(480,400)" to="(480,470)"/>
|
||||
<wire from="(570,550)" to="(570,630)"/>
|
||||
<wire from="(780,340)" to="(780,360)"/>
|
||||
<wire from="(170,160)" to="(170,170)"/>
|
||||
<wire from="(140,500)" to="(210,500)"/>
|
||||
<wire from="(70,550)" to="(150,550)"/>
|
||||
<wire from="(210,390)" to="(220,390)"/>
|
||||
<wire from="(60,370)" to="(120,370)"/>
|
||||
<wire from="(600,330)" to="(600,460)"/>
|
||||
<wire from="(710,350)" to="(710,360)"/>
|
||||
<wire from="(0,380)" to="(0,670)"/>
|
||||
<wire from="(160,390)" to="(180,390)"/>
|
||||
<wire from="(810,420)" to="(820,420)"/>
|
||||
<wire from="(640,540)" to="(660,540)"/>
|
||||
<wire from="(480,800)" to="(530,800)"/>
|
||||
<wire from="(310,790)" to="(380,790)"/>
|
||||
<wire from="(860,520)" to="(860,610)"/>
|
||||
<wire from="(470,370)" to="(470,380)"/>
|
||||
<wire from="(430,320)" to="(430,330)"/>
|
||||
<wire from="(640,600)" to="(660,600)"/>
|
||||
<wire from="(820,580)" to="(820,660)"/>
|
||||
<wire from="(710,550)" to="(710,590)"/>
|
||||
<wire from="(520,380)" to="(530,380)"/>
|
||||
<wire from="(420,470)" to="(470,470)"/>
|
||||
<wire from="(10,420)" to="(50,420)"/>
|
||||
<wire from="(430,350)" to="(430,400)"/>
|
||||
<wire from="(190,570)" to="(190,670)"/>
|
||||
<wire from="(100,360)" to="(100,380)"/>
|
||||
<wire from="(610,360)" to="(710,360)"/>
|
||||
<wire from="(710,540)" to="(760,540)"/>
|
||||
<wire from="(750,360)" to="(780,360)"/>
|
||||
<wire from="(840,560)" to="(850,560)"/>
|
||||
<wire from="(110,340)" to="(130,340)"/>
|
||||
<wire from="(270,310)" to="(280,310)"/>
|
||||
<wire from="(170,160)" to="(180,160)"/>
|
||||
<wire from="(270,310)" to="(270,340)"/>
|
||||
<wire from="(430,400)" to="(480,400)"/>
|
||||
<wire from="(840,380)" to="(840,400)"/>
|
||||
<wire from="(430,350)" to="(440,350)"/>
|
||||
<wire from="(80,430)" to="(90,430)"/>
|
||||
<wire from="(480,770)" to="(780,770)"/>
|
||||
<wire from="(630,550)" to="(630,580)"/>
|
||||
<wire from="(490,500)" to="(500,500)"/>
|
||||
<wire from="(570,810)" to="(610,810)"/>
|
||||
<wire from="(640,540)" to="(640,590)"/>
|
||||
<wire from="(830,580)" to="(830,670)"/>
|
||||
<wire from="(10,230)" to="(10,410)"/>
|
||||
<wire from="(630,520)" to="(630,550)"/>
|
||||
<wire from="(610,810)" to="(610,870)"/>
|
||||
<comp lib="1" loc="(420,790)" name="NOR Gate">
|
||||
<a name="size" val="30"/>
|
||||
<a name="inputs" val="3"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(70,550)" name="Pin">
|
||||
<a name="tristate" val="false"/>
|
||||
<a name="label" val="prog"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(270,340)" name="Splitter">
|
||||
<a name="incoming" val="16"/>
|
||||
<a name="bit1" val="0"/>
|
||||
<a name="bit2" val="0"/>
|
||||
<a name="bit3" val="0"/>
|
||||
<a name="bit4" val="0"/>
|
||||
<a name="bit5" val="0"/>
|
||||
<a name="bit6" val="0"/>
|
||||
<a name="bit7" val="0"/>
|
||||
<a name="bit8" val="1"/>
|
||||
<a name="bit9" val="1"/>
|
||||
<a name="bit10" val="1"/>
|
||||
<a name="bit11" val="1"/>
|
||||
<a name="bit12" val="1"/>
|
||||
<a name="bit13" val="1"/>
|
||||
<a name="bit14" val="1"/>
|
||||
<a name="bit15" val="1"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(910,510)" name="Splitter">
|
||||
<a name="facing" val="west"/>
|
||||
<a name="appear" val="right"/>
|
||||
</comp>
|
||||
<comp lib="1" loc="(240,510)" name="AND Gate">
|
||||
<a name="size" val="30"/>
|
||||
<a name="inputs" val="2"/>
|
||||
<a name="negate1" val="true"/>
|
||||
</comp>
|
||||
<comp lib="4" loc="(110,340)" name="Counter"/>
|
||||
<comp lib="4" loc="(270,340)" name="RAM">
|
||||
<a name="dataWidth" val="16"/>
|
||||
<a name="bus" val="separate"/>
|
||||
</comp>
|
||||
<comp lib="1" loc="(920,410)" name="NOT Gate"/>
|
||||
<comp lib="0" loc="(290,800)" name="Splitter">
|
||||
<a name="fanout" val="5"/>
|
||||
<a name="incoming" val="8"/>
|
||||
<a name="bit1" val="0"/>
|
||||
<a name="bit2" val="1"/>
|
||||
<a name="bit3" val="1"/>
|
||||
<a name="bit4" val="2"/>
|
||||
<a name="bit5" val="2"/>
|
||||
<a name="bit6" val="3"/>
|
||||
<a name="bit7" val="4"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(940,510)" name="Splitter"/>
|
||||
<comp lib="1" loc="(210,390)" name="NOT Gate"/>
|
||||
<comp lib="2" loc="(750,360)" name="Multiplexer">
|
||||
<a name="disabled" val="0"/>
|
||||
<a name="enable" val="false"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(160,150)" name="Pin">
|
||||
<a name="width" val="8"/>
|
||||
<a name="tristate" val="false"/>
|
||||
<a name="label" val="Opcode"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(200,170)" name="Splitter">
|
||||
<a name="facing" val="west"/>
|
||||
<a name="incoming" val="16"/>
|
||||
<a name="appear" val="right"/>
|
||||
<a name="bit0" val="1"/>
|
||||
<a name="bit2" val="1"/>
|
||||
<a name="bit3" val="1"/>
|
||||
<a name="bit4" val="1"/>
|
||||
<a name="bit5" val="1"/>
|
||||
<a name="bit6" val="1"/>
|
||||
<a name="bit7" val="1"/>
|
||||
<a name="bit8" val="0"/>
|
||||
<a name="bit9" val="0"/>
|
||||
<a name="bit10" val="0"/>
|
||||
<a name="bit11" val="0"/>
|
||||
<a name="bit12" val="0"/>
|
||||
<a name="bit13" val="0"/>
|
||||
<a name="bit14" val="0"/>
|
||||
<a name="bit15" val="0"/>
|
||||
</comp>
|
||||
<comp lib="2" loc="(800,560)" name="Multiplexer">
|
||||
<a name="select" val="2"/>
|
||||
<a name="width" val="8"/>
|
||||
<a name="disabled" val="0"/>
|
||||
<a name="enable" val="false"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(560,520)" name="Pull Resistor"/>
|
||||
<comp lib="3" loc="(570,810)" name="Comparator">
|
||||
<a name="width" val="2"/>
|
||||
<a name="mode" val="unsigned"/>
|
||||
</comp>
|
||||
<comp lib="4" loc="(840,560)" name="Register"/>
|
||||
<comp lib="0" loc="(70,570)" name="Pin">
|
||||
<a name="tristate" val="false"/>
|
||||
<a name="label" val="reset"/>
|
||||
</comp>
|
||||
<comp lib="4" loc="(940,510)" name="Register">
|
||||
<a name="width" val="2"/>
|
||||
</comp>
|
||||
<comp lib="3" loc="(700,530)" name="Adder"/>
|
||||
<comp lib="0" loc="(70,490)" name="Pin">
|
||||
<a name="tristate" val="false"/>
|
||||
<a name="label" val="clk"/>
|
||||
</comp>
|
||||
<comp lib="1" loc="(270,520)" name="AND Gate">
|
||||
<a name="size" val="30"/>
|
||||
<a name="inputs" val="2"/>
|
||||
<a name="negate1" val="true"/>
|
||||
</comp>
|
||||
<comp lib="4" loc="(580,330)" name="RAM">
|
||||
<a name="bus" val="separate"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(70,510)" name="Clock"/>
|
||||
<comp lib="0" loc="(160,190)" name="Pin">
|
||||
<a name="tristate" val="false"/>
|
||||
<a name="label" val="str"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(70,530)" name="Pin">
|
||||
<a name="tristate" val="false"/>
|
||||
<a name="label" val="m/a"/>
|
||||
</comp>
|
||||
<comp lib="1" loc="(200,430)" name="AND Gate">
|
||||
<a name="size" val="30"/>
|
||||
<a name="inputs" val="2"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(560,590)" name="Pull Resistor"/>
|
||||
<comp lib="0" loc="(820,420)" name="Splitter"/>
|
||||
<comp lib="1" loc="(520,380)" name="NOT Gate"/>
|
||||
<comp lib="2" loc="(540,590)" name="Multiplexer">
|
||||
<a name="select" val="2"/>
|
||||
<a name="width" val="8"/>
|
||||
<a name="disabled" val="0"/>
|
||||
<a name="enable" val="false"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(530,820)" name="Constant">
|
||||
<a name="width" val="2"/>
|
||||
<a name="value" val="0x3"/>
|
||||
</comp>
|
||||
<comp lib="2" loc="(80,430)" name="Multiplexer">
|
||||
<a name="disabled" val="0"/>
|
||||
<a name="enable" val="false"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(160,170)" name="Pin">
|
||||
<a name="width" val="8"/>
|
||||
<a name="tristate" val="false"/>
|
||||
<a name="label" val="Addr"/>
|
||||
</comp>
|
||||
<comp lib="3" loc="(700,590)" name="Subtractor"/>
|
||||
<comp lib="2" loc="(100,500)" name="Multiplexer">
|
||||
<a name="disabled" val="0"/>
|
||||
<a name="enable" val="false"/>
|
||||
</comp>
|
||||
<comp lib="1" loc="(900,530)" name="AND Gate">
|
||||
<a name="size" val="30"/>
|
||||
<a name="inputs" val="2"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(800,460)" name="Pull Resistor"/>
|
||||
<comp lib="0" loc="(280,310)" name="Pull Resistor"/>
|
||||
<comp lib="2" loc="(540,520)" name="Multiplexer">
|
||||
<a name="select" val="2"/>
|
||||
<a name="width" val="8"/>
|
||||
<a name="disabled" val="0"/>
|
||||
<a name="enable" val="false"/>
|
||||
</comp>
|
||||
<comp loc="(840,500)" name="Zero?"/>
|
||||
</circuit>
|
||||
<circuit name="Zero?">
|
||||
<a name="circuit" val="Zero?"/>
|
||||
<a name="clabel" val="Z"/>
|
||||
<a name="clabelup" val="north"/>
|
||||
<a name="clabelfont" val="SansSerif plain 12"/>
|
||||
<appear>
|
||||
<path d="M61,58 Q65,68 69,58" fill="none" stroke="#808080" stroke-width="2"/>
|
||||
<rect fill="none" height="23" stroke="#000000" stroke-width="2" width="31" x="50" y="57"/>
|
||||
<circ-port height="8" pin="370,360" width="8" x="46" y="66"/>
|
||||
<circ-port height="10" pin="490,320" width="10" x="75" y="65"/>
|
||||
<circ-anchor facing="east" height="6" width="6" x="77" y="67"/>
|
||||
</appear>
|
||||
<wire from="(400,350)" to="(400,360)"/>
|
||||
<wire from="(390,340)" to="(410,340)"/>
|
||||
<wire from="(420,330)" to="(420,340)"/>
|
||||
<wire from="(410,340)" to="(410,350)"/>
|
||||
<wire from="(420,340)" to="(430,340)"/>
|
||||
<wire from="(390,300)" to="(430,300)"/>
|
||||
<wire from="(410,350)" to="(430,350)"/>
|
||||
<wire from="(390,330)" to="(420,330)"/>
|
||||
<wire from="(400,360)" to="(430,360)"/>
|
||||
<wire from="(390,280)" to="(430,280)"/>
|
||||
<wire from="(390,320)" to="(430,320)"/>
|
||||
<wire from="(430,320)" to="(430,330)"/>
|
||||
<wire from="(390,310)" to="(430,310)"/>
|
||||
<wire from="(390,290)" to="(430,290)"/>
|
||||
<wire from="(390,350)" to="(400,350)"/>
|
||||
<comp lib="0" loc="(370,360)" name="Splitter">
|
||||
<a name="fanout" val="8"/>
|
||||
<a name="incoming" val="8"/>
|
||||
</comp>
|
||||
<comp lib="1" loc="(490,320)" name="NOR Gate">
|
||||
<a name="inputs" val="8"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(370,360)" name="Pin">
|
||||
<a name="width" val="8"/>
|
||||
<a name="tristate" val="false"/>
|
||||
<a name="label" val="In"/>
|
||||
</comp>
|
||||
<comp lib="0" loc="(490,320)" name="Pin">
|
||||
<a name="facing" val="west"/>
|
||||
<a name="output" val="true"/>
|
||||
<a name="label" val="Zero?"/>
|
||||
<a name="labelloc" val="east"/>
|
||||
</comp>
|
||||
</circuit>
|
||||
</project>
|
5
cpu 3/imm load.asm
Normal file
5
cpu 3/imm load.asm
Normal file
@ -0,0 +1,5 @@
|
||||
I M = s j 08
|
||||
M M + S j 00
|
||||
I M = s j 10
|
||||
M M + S j 01
|
||||
M M H s j 00
|
6
cpu 3/imm load.code
Normal file
6
cpu 3/imm load.code
Normal file
@ -0,0 +1,6 @@
|
||||
v2.0 raw
|
||||
2108
|
||||
4000
|
||||
2110
|
||||
4001
|
||||
3000
|
15
cpu 3/ins set.txt
Normal file
15
cpu 3/ins set.txt
Normal file
@ -0,0 +1,15 @@
|
||||
Opcode format:
|
||||
Bits 0-1:A select
|
||||
Bits 2-3:B select
|
||||
Bits 4-5:Op select
|
||||
Bit 6:Store
|
||||
Bit 7:Jump
|
||||
A/B select:
|
||||
00-Memory
|
||||
01-Immediate
|
||||
10-Result
|
||||
Op select:
|
||||
00-Add
|
||||
01-Sub
|
||||
10-Pass through A sel to R
|
||||
11-Halt
|
4
cpu 3/test.asm
Normal file
4
cpu 3/test.asm
Normal file
@ -0,0 +1,4 @@
|
||||
M M = s j 00
|
||||
R M + s j 01
|
||||
M M + S j 02
|
||||
M M H s j 00
|
5
cpu 3/test.code
Normal file
5
cpu 3/test.code
Normal file
@ -0,0 +1,5 @@
|
||||
v2.0 raw
|
||||
2000
|
||||
0201
|
||||
4002
|
||||
3000
|
Loading…
Reference in New Issue
Block a user