Browse Source

improvements of both cpu.circ and 'rapport'

master
mortie 7 years ago
parent
commit
e824032896
3 changed files with 382 additions and 241 deletions
  1. 305
    241
      inf2270/hw2/cpu.circ
  2. 77
    0
      inf2270/hw2/rapport.mdn
  3. BIN
      inf2270/hw2/rapport.pdf

+ 305
- 241
inf2270/hw2/cpu.circ View File

@@ -31,6 +31,9 @@ This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</tool>
<tool name="Controlled Buffer">
<a name="facing" val="south"/>
</tool>
</lib>
<lib desc="#Plexers" name="2">
<tool name="Multiplexer">
@@ -92,12 +95,12 @@ This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
</tool>
<sep/>
<tool lib="0" name="Pin">
<a name="facing" val="south"/>
<a name="tristate" val="false"/>
</tool>
<tool lib="0" name="Pin">
<a name="facing" val="south"/>
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="width" val="4"/>
<a name="labelloc" val="east"/>
</tool>
<tool lib="1" name="NOT Gate"/>
@@ -109,237 +112,148 @@ This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
<a name="clabel" val=""/>
<a name="clabelup" val="east"/>
<a name="clabelfont" val="SansSerif plain 12"/>
<wire from="(660,260)" to="(660,270)"/>
<wire from="(450,400)" to="(450,470)"/>
<wire from="(580,180)" to="(580,190)"/>
<wire from="(270,180)" to="(270,250)"/>
<wire from="(270,250)" to="(270,390)"/>
<wire from="(210,170)" to="(210,180)"/>
<wire from="(250,170)" to="(250,180)"/>
<wire from="(500,300)" to="(550,300)"/>
<wire from="(400,320)" to="(400,330)"/>
<wire from="(300,180)" to="(300,190)"/>
<wire from="(560,210)" to="(600,210)"/>
<wire from="(580,190)" to="(620,190)"/>
<wire from="(640,480)" to="(640,510)"/>
<wire from="(350,250)" to="(350,260)"/>
<wire from="(400,360)" to="(570,360)"/>
<wire from="(330,250)" to="(330,270)"/>
<wire from="(390,270)" to="(390,290)"/>
<wire from="(180,120)" to="(180,140)"/>
<wire from="(280,120)" to="(280,150)"/>
<wire from="(560,160)" to="(560,180)"/>
<wire from="(700,260)" to="(700,280)"/>
<wire from="(570,250)" to="(570,290)"/>
<wire from="(680,480)" to="(680,520)"/>
<wire from="(550,460)" to="(570,460)"/>
<wire from="(450,470)" to="(480,470)"/>
<wire from="(440,390)" to="(440,500)"/>
<wire from="(270,180)" to="(270,290)"/>
<wire from="(310,290)" to="(310,320)"/>
<wire from="(310,330)" to="(310,360)"/>
<wire from="(180,120)" to="(280,120)"/>
<wire from="(530,350)" to="(530,390)"/>
<wire from="(210,210)" to="(240,210)"/>
<wire from="(230,230)" to="(260,230)"/>
<wire from="(310,360)" to="(400,360)"/>
<wire from="(410,270)" to="(410,310)"/>
<wire from="(410,310)" to="(420,310)"/>
<wire from="(480,160)" to="(490,160)"/>
<wire from="(260,180)" to="(270,180)"/>
<wire from="(270,150)" to="(280,150)"/>
<wire from="(310,330)" to="(320,330)"/>
<wire from="(180,140)" to="(190,140)"/>
<wire from="(290,370)" to="(370,370)"/>
<wire from="(310,290)" to="(390,290)"/>
<wire from="(230,150)" to="(240,150)"/>
<wire from="(440,500)" to="(520,500)"/>
<wire from="(720,440)" to="(720,490)"/>
<wire from="(460,490)" to="(720,490)"/>
<wire from="(560,440)" to="(570,440)"/>
<wire from="(430,380)" to="(430,510)"/>
<wire from="(250,260)" to="(250,270)"/>
<wire from="(250,220)" to="(250,230)"/>
<wire from="(230,290)" to="(270,290)"/>
<wire from="(560,210)" to="(560,230)"/>
<wire from="(550,440)" to="(550,460)"/>
<wire from="(550,160)" to="(550,180)"/>
<wire from="(570,180)" to="(570,200)"/>
<wire from="(600,210)" to="(600,230)"/>
<wire from="(580,190)" to="(580,230)"/>
<wire from="(620,190)" to="(620,230)"/>
<wire from="(600,250)" to="(600,290)"/>
<wire from="(430,510)" to="(640,510)"/>
<wire from="(490,290)" to="(490,400)"/>
<wire from="(480,160)" to="(500,160)"/>
<wire from="(650,310)" to="(740,310)"/>
<wire from="(640,300)" to="(730,300)"/>
<wire from="(230,270)" to="(250,270)"/>
<wire from="(530,460)" to="(530,520)"/>
<wire from="(250,220)" to="(260,220)"/>
<wire from="(460,410)" to="(540,410)"/>
<wire from="(710,440)" to="(720,440)"/>
<wire from="(600,250)" to="(610,250)"/>
<wire from="(740,180)" to="(740,310)"/>
<wire from="(480,460)" to="(480,470)"/>
<wire from="(550,220)" to="(590,220)"/>
<wire from="(570,200)" to="(610,200)"/>
<wire from="(550,300)" to="(590,300)"/>
<wire from="(560,180)" to="(560,210)"/>
<wire from="(180,120)" to="(180,140)"/>
<wire from="(730,220)" to="(730,300)"/>
<wire from="(580,160)" to="(580,180)"/>
<wire from="(180,120)" to="(280,120)"/>
<wire from="(440,390)" to="(480,390)"/>
<wire from="(430,380)" to="(470,380)"/>
<wire from="(450,400)" to="(490,400)"/>
<wire from="(520,460)" to="(520,500)"/>
<wire from="(420,290)" to="(420,520)"/>
<wire from="(210,210)" to="(240,210)"/>
<wire from="(480,290)" to="(480,390)"/>
<wire from="(570,140)" to="(590,140)"/>
<wire from="(550,380)" to="(640,380)"/>
<wire from="(560,390)" to="(650,390)"/>
<wire from="(270,290)" to="(420,290)"/>
<wire from="(610,280)" to="(700,280)"/>
<wire from="(500,440)" to="(510,440)"/>
<wire from="(460,440)" to="(470,440)"/>
<wire from="(720,220)" to="(730,220)"/>
<wire from="(540,440)" to="(550,440)"/>
<wire from="(550,220)" to="(550,230)"/>
<wire from="(570,320)" to="(570,330)"/>
<wire from="(590,220)" to="(590,230)"/>
<wire from="(610,320)" to="(610,330)"/>
<wire from="(610,280)" to="(610,290)"/>
<wire from="(500,290)" to="(500,300)"/>
<wire from="(380,340)" to="(380,390)"/>
<wire from="(280,380)" to="(410,380)"/>
<wire from="(570,310)" to="(570,360)"/>
<wire from="(300,280)" to="(300,350)"/>
<wire from="(260,230)" to="(310,230)"/>
<wire from="(400,350)" to="(400,360)"/>
<wire from="(260,170)" to="(260,180)"/>
<wire from="(260,210)" to="(260,220)"/>
<wire from="(560,270)" to="(660,270)"/>
<wire from="(420,520)" to="(530,520)"/>
<wire from="(570,200)" to="(570,230)"/>
<wire from="(610,200)" to="(610,230)"/>
<wire from="(640,300)" to="(640,380)"/>
<wire from="(650,310)" to="(650,390)"/>
<wire from="(460,410)" to="(460,440)"/>
<wire from="(320,250)" to="(320,260)"/>
<wire from="(330,340)" to="(330,350)"/>
<wire from="(340,210)" to="(340,220)"/>
<wire from="(260,210)" to="(260,230)"/>
<wire from="(390,220)" to="(390,240)"/>
<wire from="(270,390)" to="(380,390)"/>
<wire from="(280,150)" to="(280,180)"/>
<wire from="(410,380)" to="(510,380)"/>
<wire from="(330,160)" to="(330,190)"/>
<wire from="(560,270)" to="(560,290)"/>
<wire from="(570,160)" to="(570,180)"/>
<wire from="(470,290)" to="(470,380)"/>
<wire from="(590,140)" to="(590,180)"/>
<wire from="(550,180)" to="(550,220)"/>
<wire from="(540,370)" to="(540,410)"/>
<wire from="(530,520)" to="(680,520)"/>
<wire from="(590,180)" to="(740,180)"/>
<wire from="(230,250)" to="(270,250)"/>
<wire from="(370,340)" to="(370,370)"/>
<wire from="(340,250)" to="(340,280)"/>
<wire from="(290,270)" to="(330,270)"/>
<wire from="(280,260)" to="(320,260)"/>
<wire from="(300,280)" to="(340,280)"/>
<wire from="(290,270)" to="(290,370)"/>
<wire from="(300,190)" to="(330,190)"/>
<wire from="(300,350)" to="(330,350)"/>
<wire from="(350,260)" to="(380,260)"/>
<wire from="(280,180)" to="(300,180)"/>
<wire from="(250,270)" to="(460,270)"/>
<wire from="(460,450)" to="(460,490)"/>
<wire from="(460,450)" to="(470,450)"/>
<wire from="(490,200)" to="(500,200)"/>
<wire from="(380,390)" to="(530,390)"/>
<wire from="(410,340)" to="(410,380)"/>
<wire from="(490,160)" to="(490,200)"/>
<wire from="(390,320)" to="(400,320)"/>
<wire from="(310,320)" to="(320,320)"/>
<wire from="(330,160)" to="(340,160)"/>
<wire from="(550,380)" to="(550,440)"/>
<wire from="(560,390)" to="(560,440)"/>
<wire from="(490,200)" to="(490,260)"/>
<comp lib="0" loc="(570,140)" name="Splitter">
<a name="facing" val="south"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="center"/>
<wire from="(350,320)" to="(360,320)"/>
<wire from="(400,270)" to="(400,320)"/>
<wire from="(390,220)" to="(470,220)"/>
<wire from="(340,210)" to="(470,210)"/>
<wire from="(280,260)" to="(280,380)"/>
<wire from="(560,310)" to="(570,310)"/>
<comp lib="6" loc="(231,108)" name="Text">
<a name="text" val="Program counter"/>
</comp>
<comp lib="4" loc="(480,160)" name="ROM">
<a name="addrWidth" val="4"/>
<a name="contents">addr/data: 4 8
85 97 b1 81 94 a1
8c 9d b0 b3 81 91 a0 b4
</a>
</comp>
<comp lib="1" loc="(250,230)" name="NOT Gate">
<a name="facing" val="north"/>
</comp>
<comp lib="0" loc="(700,260)" name="Splitter">
<a name="facing" val="north"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="center"/>
<comp lib="4" loc="(390,320)" name="Register">
<a name="trigger" val="falling"/>
</comp>
<comp lib="4" loc="(270,150)" name="Register">
<a name="width" val="4"/>
<comp lib="6" loc="(577,339)" name="Text">
<a name="text" val="System bus"/>
<a name="halign" val="left"/>
</comp>
<comp loc="(570,320)" name="mux-4">
<a name="facing" val="south"/>
</comp>
<comp lib="0" loc="(500,160)" name="Splitter">
<a name="facing" val="south"/>
<a name="fanout" val="8"/>
<comp lib="0" loc="(490,200)" name="Splitter">
<a name="facing" val="west"/>
<a name="incoming" val="8"/>
<a name="bit0" val="1"/>
<a name="bit2" val="1"/>
<a name="bit3" val="1"/>
<a name="bit4" val="0"/>
<a name="bit5" val="0"/>
<a name="bit6" val="0"/>
<a name="bit7" val="0"/>
</comp>
<comp lib="5" loc="(230,250)" name="Button">
<a name="label" val="Reset"/>
<a name="labelloc" val="west"/>
</comp>
<comp lib="0" loc="(570,250)" name="Splitter">
<a name="facing" val="north"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="center"/>
</comp>
<comp lib="0" loc="(610,330)" name="Splitter">
<a name="facing" val="south"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="center"/>
<comp loc="(390,240)" name="direct-input"/>
<comp lib="4" loc="(560,310)" name="RAM">
<a name="addrWidth" val="4"/>
<a name="bus" val="asynch"/>
</comp>
<comp lib="0" loc="(540,370)" name="Splitter">
<comp lib="1" loc="(510,350)" name="NOT Gate">
<a name="facing" val="north"/>
<a name="fanout" val="8"/>
<a name="incoming" val="8"/>
<a name="appear" val="right"/>
</comp>
<comp lib="0" loc="(610,250)" name="Splitter">
<comp loc="(330,220)" name="decode"/>
<comp lib="1" loc="(250,180)" name="AND Gate">
<a name="facing" val="north"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="center"/>
</comp>
<comp lib="1" loc="(210,210)" name="NOT Gate">
<a name="facing" val="south"/>
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="5" loc="(300,180)" name="Hex Digit Display"/>
<comp lib="0" loc="(190,160)" name="Constant">
<a name="width" val="4"/>
</comp>
<comp lib="0" loc="(720,220)" name="Splitter">
<a name="facing" val="south"/>
<a name="fanout" val="8"/>
<a name="incoming" val="8"/>
<a name="appear" val="right"/>
</comp>
<comp lib="5" loc="(300,180)" name="Hex Digit Display"/>
<comp lib="5" loc="(230,290)" name="Button">
<a name="label" val="Reset"/>
<comp lib="5" loc="(230,230)" name="Button">
<a name="label" val="Clock"/>
<a name="labelloc" val="west"/>
</comp>
<comp lib="4" loc="(540,440)" name="Register">
<comp lib="4" loc="(270,150)" name="Register">
<a name="width" val="4"/>
<a name="trigger" val="falling"/>
</comp>
<comp lib="6" loc="(411,111)" name="Text">
<a name="text" val="Program ROM"/>
</comp>
<comp loc="(500,440)" name="mux-8"/>
<comp lib="0" loc="(660,260)" name="Splitter">
<a name="facing" val="north"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="center"/>
</comp>
<comp lib="0" loc="(500,200)" name="Splitter">
<a name="facing" val="north"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="right"/>
</comp>
<comp loc="(610,320)" name="mux-4">
<a name="facing" val="south"/>
</comp>
<comp lib="3" loc="(230,150)" name="Adder">
<a name="width" val="4"/>
</comp>
<comp lib="4" loc="(710,440)" name="RAM">
<a name="addrWidth" val="4"/>
<a name="bus" val="separate"/>
<comp lib="1" loc="(210,210)" name="NOT Gate">
<a name="facing" val="south"/>
</comp>
<comp lib="5" loc="(230,270)" name="Button">
<a name="label" val="Clock"/>
<a name="labelloc" val="west"/>
<comp loc="(350,320)" name="mux-8"/>
<comp lib="6" loc="(411,111)" name="Text">
<a name="text" val="Program ROM"/>
</comp>
<comp loc="(480,260)" name="decode"/>
<comp lib="1" loc="(250,180)" name="AND Gate">
<a name="facing" val="north"/>
<a name="size" val="30"/>
<a name="inputs" val="2"/>
<comp lib="6" loc="(728,465)" name="Text">
<a name="halign" val="left"/>
</comp>
<comp lib="0" loc="(570,330)" name="Splitter">
<comp lib="1" loc="(400,350)" name="Controlled Buffer">
<a name="facing" val="south"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="center"/>
</comp>
<comp lib="6" loc="(231,108)" name="Text">
<a name="text" val="Program counter"/>
<a name="width" val="8"/>
<a name="control" val="left"/>
</comp>
</circuit>
<circuit name="mux-4">
@@ -366,25 +280,17 @@ This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
<wire from="(250,310)" to="(250,340)"/>
<wire from="(220,230)" to="(240,230)"/>
<wire from="(220,270)" to="(240,270)"/>
<comp lib="1" loc="(260,230)" name="Controlled Buffer">
<a name="width" val="4"/>
<a name="control" val="left"/>
</comp>
<comp lib="1" loc="(250,200)" name="NOT Gate">
<a name="facing" val="west"/>
</comp>
<comp lib="0" loc="(220,270)" name="Pin">
<a name="width" val="4"/>
<a name="tristate" val="false"/>
<a name="label" val="Input 1"/>
</comp>
<comp lib="1" loc="(260,270)" name="Controlled Buffer">
<comp lib="1" loc="(260,230)" name="Controlled Buffer">
<a name="width" val="4"/>
<a name="control" val="left"/>
</comp>
<comp lib="0" loc="(250,340)" name="Pin">
<a name="facing" val="north"/>
<a name="tristate" val="false"/>
<a name="label" val="Control"/>
<comp lib="1" loc="(260,270)" name="Controlled Buffer">
<a name="width" val="4"/>
</comp>
<comp lib="0" loc="(370,250)" name="Pin">
<a name="facing" val="west"/>
@@ -393,11 +299,19 @@ This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
<a name="label" val="Output"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="0" loc="(250,340)" name="Pin">
<a name="facing" val="north"/>
<a name="tristate" val="false"/>
<a name="label" val="Control"/>
</comp>
<comp lib="0" loc="(220,230)" name="Pin">
<a name="width" val="4"/>
<a name="tristate" val="false"/>
<a name="label" val="Input 0"/>
</comp>
<comp lib="1" loc="(250,200)" name="NOT Gate">
<a name="facing" val="west"/>
</comp>
</circuit>
<circuit name="mux-8">
<a name="circuit" val="mux-8"/>
@@ -423,13 +337,6 @@ This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
<wire from="(250,280)" to="(250,310)"/>
<wire from="(220,230)" to="(240,230)"/>
<wire from="(220,270)" to="(240,270)"/>
<comp lib="1" loc="(260,230)" name="Controlled Buffer">
<a name="width" val="8"/>
<a name="control" val="left"/>
</comp>
<comp lib="1" loc="(260,270)" name="Controlled Buffer">
<a name="width" val="8"/>
</comp>
<comp lib="0" loc="(370,250)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
@@ -440,20 +347,27 @@ This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
<comp lib="1" loc="(250,200)" name="NOT Gate">
<a name="facing" val="west"/>
</comp>
<comp lib="0" loc="(220,270)" name="Pin">
<comp lib="1" loc="(260,230)" name="Controlled Buffer">
<a name="width" val="8"/>
<a name="control" val="left"/>
</comp>
<comp lib="1" loc="(260,270)" name="Controlled Buffer">
<a name="width" val="8"/>
</comp>
<comp lib="0" loc="(250,340)" name="Pin">
<a name="facing" val="north"/>
<a name="tristate" val="false"/>
<a name="label" val="Input 1"/>
<a name="label" val="Control"/>
</comp>
<comp lib="0" loc="(220,230)" name="Pin">
<a name="width" val="8"/>
<a name="tristate" val="false"/>
<a name="label" val="Input 0"/>
</comp>
<comp lib="0" loc="(250,340)" name="Pin">
<a name="facing" val="north"/>
<comp lib="0" loc="(220,270)" name="Pin">
<a name="width" val="8"/>
<a name="tristate" val="false"/>
<a name="label" val="Control"/>
<a name="label" val="Input 1"/>
</comp>
</circuit>
<circuit name="decode">
@@ -497,15 +411,31 @@ This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
<wire from="(190,200)" to="(200,200)"/>
<wire from="(240,240)" to="(250,240)"/>
<wire from="(270,260)" to="(270,320)"/>
<comp lib="0" loc="(330,270)" name="Pin">
<comp lib="0" loc="(330,350)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="label" val="low=MSB, high=LSB"/>
<a name="label" val="write R"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="0" loc="(190,200)" name="Pin">
<a name="tristate" val="false"/>
<a name="label" val="Enable"/>
<comp lib="1" loc="(220,210)" name="NOT Gate">
<a name="facing" val="south"/>
</comp>
<comp lib="1" loc="(320,310)" name="OR Gate">
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="1" loc="(210,250)" name="AND Gate">
<a name="facing" val="south"/>
<a name="size" val="30"/>
<a name="inputs" val="3"/>
</comp>
<comp lib="0" loc="(240,200)" name="Splitter">
<a name="facing" val="north"/>
<a name="appear" val="center"/>
</comp>
<comp lib="1" loc="(320,350)" name="OR Gate">
<a name="size" val="30"/>
<a name="inputs" val="3"/>
</comp>
<comp lib="0" loc="(230,160)" name="Splitter">
<a name="facing" val="south"/>
@@ -513,10 +443,15 @@ This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
<a name="incoming" val="4"/>
<a name="appear" val="center"/>
</comp>
<comp lib="2" loc="(250,240)" name="Decoder">
<a name="facing" val="south"/>
<a name="select" val="2"/>
<a name="disabled" val="0"/>
<comp lib="0" loc="(330,270)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="label" val="low=MSB, high=LSB"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="0" loc="(190,200)" name="Pin">
<a name="tristate" val="false"/>
<a name="label" val="Enable"/>
</comp>
<comp lib="0" loc="(330,390)" name="Pin">
<a name="facing" val="west"/>
@@ -524,22 +459,15 @@ This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
<a name="label" val="write RAM"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="1" loc="(210,250)" name="AND Gate">
<a name="facing" val="south"/>
<a name="size" val="30"/>
<a name="inputs" val="3"/>
</comp>
<comp lib="1" loc="(320,310)" name="OR Gate">
<a name="size" val="30"/>
<a name="inputs" val="2"/>
</comp>
<comp lib="1" loc="(220,210)" name="NOT Gate">
<comp lib="2" loc="(250,240)" name="Decoder">
<a name="facing" val="south"/>
<a name="select" val="2"/>
<a name="disabled" val="0"/>
</comp>
<comp lib="0" loc="(330,350)" name="Pin">
<comp lib="0" loc="(330,310)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="label" val="write R"/>
<a name="label" val="low=input, high=ram"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="0" loc="(230,160)" name="Pin">
@@ -547,19 +475,155 @@ This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
<a name="width" val="4"/>
<a name="tristate" val="false"/>
</comp>
<comp lib="0" loc="(240,200)" name="Splitter">
</circuit>
<circuit name="direct-input">
<a name="circuit" val="direct-input"/>
<a name="clabel" val=""/>
<a name="clabelup" val="east"/>
<a name="clabelfont" val="SansSerif plain 12"/>
<appear>
<rect fill="none" height="30" stroke="#000000" stroke-width="2" width="40" x="50" y="50"/>
<text font-family="SansSerif" font-size="12" text-anchor="middle" x="69" y="68">input</text>
<circ-port height="8" pin="530,160" width="8" x="56" y="46"/>
<circ-port height="8" pin="520,290" width="8" x="46" y="66"/>
<circ-port height="10" pin="730,180" width="10" x="75" y="75"/>
<circ-port height="8" pin="730,210" width="8" x="66" y="76"/>
<circ-port height="10" pin="540,370" width="10" x="55" y="75"/>
<circ-anchor facing="east" height="6" width="6" x="57" y="47"/>
</appear>
<wire from="(660,250)" to="(660,260)"/>
<wire from="(550,220)" to="(550,230)"/>
<wire from="(580,180)" to="(580,190)"/>
<wire from="(570,310)" to="(570,320)"/>
<wire from="(540,360)" to="(540,370)"/>
<wire from="(590,220)" to="(590,230)"/>
<wire from="(610,310)" to="(610,320)"/>
<wire from="(610,270)" to="(610,280)"/>
<wire from="(560,210)" to="(600,210)"/>
<wire from="(580,190)" to="(620,190)"/>
<wire from="(550,220)" to="(590,220)"/>
<wire from="(570,200)" to="(610,200)"/>
<wire from="(550,290)" to="(590,290)"/>
<wire from="(560,260)" to="(660,260)"/>
<wire from="(570,200)" to="(570,230)"/>
<wire from="(560,180)" to="(560,210)"/>
<wire from="(570,250)" to="(570,280)"/>
<wire from="(610,200)" to="(610,230)"/>
<wire from="(600,250)" to="(600,280)"/>
<wire from="(560,210)" to="(560,230)"/>
<wire from="(580,160)" to="(580,180)"/>
<wire from="(570,160)" to="(570,180)"/>
<wire from="(570,180)" to="(570,200)"/>
<wire from="(550,160)" to="(550,180)"/>
<wire from="(560,160)" to="(560,180)"/>
<wire from="(560,260)" to="(560,280)"/>
<wire from="(600,210)" to="(600,230)"/>
<wire from="(700,250)" to="(700,270)"/>
<wire from="(580,190)" to="(580,230)"/>
<wire from="(590,140)" to="(590,180)"/>
<wire from="(550,180)" to="(550,220)"/>
<wire from="(620,190)" to="(620,230)"/>
<wire from="(570,140)" to="(590,140)"/>
<wire from="(520,290)" to="(550,290)"/>
<wire from="(610,270)" to="(700,270)"/>
<wire from="(590,180)" to="(730,180)"/>
<wire from="(720,210)" to="(730,210)"/>
<wire from="(530,160)" to="(540,160)"/>
<wire from="(600,250)" to="(610,250)"/>
<comp lib="0" loc="(530,160)" name="Pin">
<a name="width" val="4"/>
<a name="tristate" val="false"/>
<a name="label" val="Input"/>
</comp>
<comp lib="0" loc="(570,250)" name="Splitter">
<a name="facing" val="north"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="center"/>
</comp>
<comp lib="1" loc="(320,350)" name="OR Gate">
<a name="size" val="30"/>
<a name="inputs" val="3"/>
<comp lib="0" loc="(540,160)" name="Splitter">
<a name="facing" val="south"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
</comp>
<comp lib="0" loc="(330,310)" name="Pin">
<comp lib="0" loc="(570,320)" 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="(700,250)" name="Splitter">
<a name="facing" val="north"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="center"/>
</comp>
<comp lib="0" loc="(610,250)" name="Splitter">
<a name="facing" val="north"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="center"/>
</comp>
<comp lib="0" loc="(660,250)" name="Splitter">
<a name="facing" val="north"/>
<a name="fanout" val="4"/>
<a name="incoming" val="4"/>
<a name="appear" val="center"/>
</comp>
<comp lib="0" loc="(570,140)" 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="(540,360)" name="Splitter">
<a name="facing" val="north"/>
<a name="fanout" val="8"/>
<a name="incoming" val="8"/>
<a name="appear" val="right"/>
</comp>
<comp lib="0" loc="(730,180)" name="Pin">
<a name="facing" val="west"/>
<a name="output" val="true"/>
<a name="label" val="low=input, high=ram"/>
<a name="width" val="4"/>
<a name="label" val="RAM address"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="0" loc="(520,290)" name="Pin">
<a name="tristate" val="false"/>
<a name="label" val="low=MSB, high=LSB"/>
</comp>
<comp lib="0" loc="(610,320)" 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="(730,210)" name="Pin">
<a name="facing" val="west"/>
<a name="width" val="8"/>
<a name="tristate" val="false"/>
<a name="label" val="Register In"/>
<a name="labelloc" val="east"/>
</comp>
<comp lib="0" loc="(540,370)" name="Pin">
<a name="facing" val="north"/>
<a name="output" val="true"/>
<a name="width" val="8"/>
<a name="label" val="Register Out"/>
<a name="labelloc" val="east"/>
</comp>
<comp loc="(570,310)" name="mux-4">
<a name="facing" val="south"/>
</comp>
<comp loc="(610,310)" name="mux-4">
<a name="facing" val="south"/>
</comp>
<comp lib="0" loc="(720,210)" name="Splitter">
<a name="facing" val="south"/>
<a name="fanout" val="8"/>
<a name="incoming" val="8"/>
<a name="appear" val="right"/>
</comp>
</circuit>
</project>

+ 77
- 0
inf2270/hw2/rapport.mdn View File

@@ -1,3 +1,80 @@
# Rapport - Martin Dørum (martindn)

## Subcircuits

### decode

Denne kretsen tar de første 4 bits fra maskinkoden, og bestemmer hva CPUen skal
gjøre. Den bestemmer om RAMen skal skrives eller leses, om registeret skal
skrives til, om inputen til registeret skal være fra maskinkoden eller fra RAM,
og om de laveste eller de høyeste bits fra maskinkoden skal endres.

### direct-input

Med instruksjonene 1000 og 1001 skriver jeg til registeret. Hva jeg skriver
blir bestemt av denne kretsen. Den tar 4 bits fra maskinkoden og 8 bits fra
registeret, og har en input som bestemmer om den skal ta de 4 nederste bits
fra registeret og de 4 øverste fra registeret, eller om den skal ta de 4
øverste bits fra registeret og de 4 nederste fra registeret. Denne inputen
kommer fra decode-kretsen.

I tillegg har den en 4 bit output som bare er de 4 bits fra maskinkoden
direkte, som brukes som RAM-addresse i de instruksjonene hvor vi vil lese
fra eller skrive til RAM.

### mux-8, mux-4

Disse kretsene tar to 4- eller 8-bit inputs, og har en `Control` input som
bestemmer om input 0 eller input 1 skal gå igjennom.

## Kretsen

Output fra program ROM går til `decode` og `direct-input`, som passer på at RAM
og registeret får de verdiene de skal ha i hendhold til maskinkoden. Når
clock-signalet går fra 0 til 1, skrus `decode` sine outputs på, og RAMen skrives
hvis det er nødvendig, registeret sin clock input slår seg på hvis det er
nødvendig, etc. Når clock-signalet går fra 1 til 0, vil alle outputs fra `decode`
slås av igjen, registeret vil skrives hvis clock-signalet var på, og
program counteren vil økes med 1.

\pagebreak

## Logg av test1.raw

| Maskinkode | Register | RAM[1] | Clock |
|:----------:|:--------:|:------:|:-----:|
| 85 | 00 | 00 | 0 |
| 85 | 00 | 00 | 1 |
| 97 | 05 | 00 | 0 |
| 97 | 05 | 00 | 1 |
| b1 | 75 | 00 | 0 |
| b1 | 75 | 75 | 1 |
| 81 | 75 | 75 | 0 |
| 81 | 75 | 75 | 1 |
| 94 | 71 | 75 | 0 |
| 94 | 71 | 75 | 1 |
| a1 | 41 | 75 | 0 |
| a1 | 41 | 75 | 1 |
| 00 | 75 | 75 | 0 |

## Logg av test2.raw

| Maskinkode | Register | RAM[0] | RAM[1] | RAM[2] | RAM[3] | RAM[4] | Clock |
|:----------:|:--------:|:------:|:------:|:------:|:------:|:------:|:-----:|
| 8c | 00 | 00 | 00 | 00 | 00 | 00 | 0 |
| 8c | 00 | 00 | 00 | 00 | 00 | 00 | 1 |
| 9d | 0c | 00 | 00 | 00 | 00 | 00 | 0 |
| 9d | 0c | 00 | 00 | 00 | 00 | 00 | 1 |
| b0 | dc | 00 | 00 | 00 | 00 | 00 | 0 |
| b0 | dc | dc | 00 | 00 | 00 | 00 | 1 |
| b3 | dc | dc | 00 | 00 | 00 | 00 | 0 |
| b3 | dc | dc | 00 | 00 | dc | 00 | 1 |
| 81 | dc | dc | 00 | 00 | dc | 00 | 0 |
| 81 | dc | dc | 00 | 00 | dc | 00 | 1 |
| 91 | d1 | dc | 00 | 00 | dc | 00 | 0 |
| 91 | d1 | dc | 00 | 00 | dc | 00 | 1 |
| a0 | 11 | dc | 00 | 00 | dc | 00 | 0 |
| a0 | 11 | dc | 00 | 00 | dc | 00 | 1 |
| b4 | dc | dc | 00 | 00 | dc | 00 | 0 |
| b4 | dc | dc | 00 | 00 | dc | dc | 1 |
| 00 | dc | dc | 00 | 00 | dc | dc | 0 |

BIN
inf2270/hw2/rapport.pdf View File


Loading…
Cancel
Save