|
1 | 1 | # Processor
|
2 |
| - |
| 2 | + |
| 3 | +This repository presents a functional, but soon-to-be fully-realized model of a 32-bit processor developed entirely from first principles. |
| 4 | +A finite-state automaton (FSA) was used to model the processor. Then, sequential logical expressions were derived from said automaton. |
| 5 | +The end goal of this project is a practical, formally verified, Turing complete processor built on an FPGA. |
| 6 | + |
| 7 | +In this repository, you will find: |
| 8 | + |
| 9 | +* [A Simulink file](https://github.com/Amjad-H-Ali/Processor/blob/main/PROCESSOR.slx) : Simulink is a MATLAB-based software for modeling and simulating systems and will need to be [installed](https://www.mathworks.com/help/install/install-products.html). The interactive version of the FSA was designed in Simulink and looks like this: |
| 10 | + |
| 11 | +<h6>Abstract overview of the FSA </h6> |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +<h6> Detailed FSA of the Multiplier </h6> |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +<h6> Detailed FSA of the Adder </h6> |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +* [An OmniGraffle file](https://github.com/Amjad-H-Ali/Processor/blob/main/PROCESSOR_MODEL_FSA.graffle) : OmniGraffle is a tool for building visual diagrams and can be installed [here](https://www.omnigroup.com/omnigraffle). The non-interactive FSA was designed in OmniGraffle and looks like this: |
| 24 | + |
| 25 | +<h6> FSA of the Multiplier </h6> |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +<h6> FSA of the Adder </h6> |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +<table> |
| 35 | + <tr> |
| 36 | + <td>BITS</td> |
| 37 | + <td>0</td> |
| 38 | + <td>1</td> |
| 39 | + <td>2</td> |
| 40 | + <td>3</td> |
| 41 | + <td>4</td> |
| 42 | + <td>5</td> |
| 43 | + <td>6</td> |
| 44 | + <td>7</td> |
| 45 | + <td>8</td> |
| 46 | + <td>9</td> |
| 47 | + <td>10</td> |
| 48 | + <td>11</td> |
| 49 | + <td>12</td> |
| 50 | + <td>13</td> |
| 51 | + <td>14</td> |
| 52 | + <td>15</td> |
| 53 | + <td>16</td> |
| 54 | + <td>17</td> |
| 55 | + <td>18</td> |
| 56 | + <td>19</td> |
| 57 | + <td>20</td> |
| 58 | + <td>21</td> |
| 59 | + <td>22</td> |
| 60 | + <td>23</td> |
| 61 | + <td>24</td> |
| 62 | + <td>25</td> |
| 63 | + <td>26</td> |
| 64 | + <td>27</td> |
| 65 | + <td>28</td> |
| 66 | + <td>29</td> |
| 67 | + <td>30</td> |
| 68 | + <td>31</td> |
| 69 | + <td>32</td> |
| 70 | + <td>33</td> |
| 71 | + <td>34</td> |
| 72 | + <td>35</td> |
| 73 | + <td>36</td> |
| 74 | + <td>37</td> |
| 75 | + <td>38</td> |
| 76 | + <td>39</td> |
| 77 | + <td>40</td> |
| 78 | + <td>41</td> |
| 79 | + <td>42</td> |
| 80 | + <td>43</td> |
| 81 | + <td>44</td> |
| 82 | + <td>45</td> |
| 83 | + <td>46</td> |
| 84 | + <td>47</td> |
| 85 | + <td>48</td> |
| 86 | + <td>49</td> |
| 87 | + <td>50</td> |
| 88 | + <td>51</td> |
| 89 | + <td>52</td> |
| 90 | + <td>53</td> |
| 91 | + <td>54</td> |
| 92 | + <td>55</td> |
| 93 | + <td>56</td> |
| 94 | + <td>57</td> |
| 95 | + <td>58</td> |
| 96 | + <td>59</td> |
| 97 | + <td>60</td> |
| 98 | + <td>61</td> |
| 99 | + <td>62</td> |
| 100 | + <td>63</td> |
| 101 | + </tr> |
| 102 | + |
| 103 | + <tr> |
| 104 | + <td>INSTRUCTION </td> |
| 105 | + <td colspan="8">ICODE</td> |
| 106 | + <td colspan="56"></td> |
| 107 | + </tr> |
| 108 | + <tr> |
| 109 | + <td>mov rA,D(rB,rC,s)</td> |
| 110 | + <td colspan="8">0</td> |
| 111 | + <td colspan="5">rA</td> |
| 112 | + <td colspan="5">rB</td> |
| 113 | + <td colspan="5">rC</td> |
| 114 | + <td colspan="4">s</td> |
| 115 | + <td colspan="32">D</td> |
| 116 | + <td colspan="5">PADDING</td> |
| 117 | + </tr> |
| 118 | + |
| 119 | + <tr> |
| 120 | + <td>mov D(rB,rC,s),rA</td> |
| 121 | + <td colspan="8">1</td> |
| 122 | + <td colspan="5">rA</td> |
| 123 | + <td colspan="5">rB</td> |
| 124 | + <td colspan="5">rC</td> |
| 125 | + <td colspan="4">s</td> |
| 126 | + <td colspan="32">D</td> |
| 127 | + <td colspan="5">PADDING</td> |
| 128 | + </tr> |
| 129 | + |
| 130 | + <tr> |
| 131 | + <td>lea rA,D(rB,rC,s)</td> |
| 132 | + <td colspan="8">2</td> |
| 133 | + <td colspan="5">rA</td> |
| 134 | + <td colspan="5">rB</td> |
| 135 | + <td colspan="5">rC</td> |
| 136 | + <td colspan="4">s</td> |
| 137 | + <td colspan="32">D</td> |
| 138 | + <td colspan="5">PADDING</td> |
| 139 | + </tr> |
| 140 | + <tr> |
| 141 | + <td>mov rA,D(rB)</td> |
| 142 | + <td colspan="8">9</td> |
| 143 | + <td colspan="5">rA</td> |
| 144 | + <td colspan="5">rB</td> |
| 145 | + <td colspan="32">D</td> |
| 146 | + <td colspan="14">PADDING</td> |
| 147 | + </tr> |
| 148 | + <tr> |
| 149 | + <td>mov D(rB),rA</td> |
| 150 | + <td colspan="8">10</td> |
| 151 | + <td colspan="5">rA</td> |
| 152 | + <td colspan="5">rB</td> |
| 153 | + <td colspan="32">D</td> |
| 154 | + <td colspan="14">PADDING</td> |
| 155 | + </tr> |
| 156 | + |
| 157 | + <tr> |
| 158 | + <td>mov rA,rB</td> |
| 159 | + <td colspan="8">17</td> |
| 160 | + <td colspan="5">rA</td> |
| 161 | + <td colspan="5">rB</td> |
| 162 | + <td colspan="46">PADDING</td> |
| 163 | + </tr> |
| 164 | + <tr> |
| 165 | + <td>movl rA,rB</td> |
| 166 | + <td colspan="8">18</td> |
| 167 | + <td colspan="5">rA</td> |
| 168 | + <td colspan="5">rB</td> |
| 169 | + <td colspan="46">PADDING</td> |
| 170 | + </tr> |
| 171 | + <tr> |
| 172 | + <td>movle rA,rB</td> |
| 173 | + <td colspan="8">19</td> |
| 174 | + <td colspan="5">rA</td> |
| 175 | + <td colspan="5">rB</td> |
| 176 | + <td colspan="46">PADDING</td> |
| 177 | + </tr> |
| 178 | + <tr> |
| 179 | + <td>movg rA,rB</td> |
| 180 | + <td colspan="8">20</td> |
| 181 | + <td colspan="5">rA</td> |
| 182 | + <td colspan="5">rB</td> |
| 183 | + <td colspan="46">PADDING</td> |
| 184 | + </tr> |
| 185 | + <tr> |
| 186 | + <td>movge rA,rB</td> |
| 187 | + <td colspan="8">21</td> |
| 188 | + <td colspan="5">rA</td> |
| 189 | + <td colspan="5">rB</td> |
| 190 | + <td colspan="46">PADDING</td> |
| 191 | + </tr> |
| 192 | + <tr> |
| 193 | + <td>move rA,rB</td> |
| 194 | + <td colspan="8">22</td> |
| 195 | + <td colspan="5">rA</td> |
| 196 | + <td colspan="5">rB</td> |
| 197 | + <td colspan="46">PADDING</td> |
| 198 | + </tr> |
| 199 | + <tr> |
| 200 | + <td>movne rA,rB</td> |
| 201 | + <td colspan="8">23</td> |
| 202 | + <td colspan="5">rA</td> |
| 203 | + <td colspan="5">rB</td> |
| 204 | + <td colspan="46">PADDING</td> |
| 205 | + </tr> |
| 206 | + <tr> |
| 207 | + <td>and rA,rB</td> |
| 208 | + <td colspan="8">24</td> |
| 209 | + <td colspan="5">rA</td> |
| 210 | + <td colspan="5">rB</td> |
| 211 | + <td colspan="46">PADDING</td> |
| 212 | + </tr> |
| 213 | + <tr> |
| 214 | + <td>or rA,rB</td> |
| 215 | + <td colspan="8">25</td> |
| 216 | + <td colspan="5">rA</td> |
| 217 | + <td colspan="5">rB</td> |
| 218 | + <td colspan="46">PADDING</td> |
| 219 | + </tr> |
| 220 | + <tr> |
| 221 | + <td>xor rA,rB</td> |
| 222 | + <td colspan="8">26</td> |
| 223 | + <td colspan="5">rA</td> |
| 224 | + <td colspan="5">rB</td> |
| 225 | + <td colspan="46">PADDING</td> |
| 226 | + </tr> |
| 227 | + <tr> |
| 228 | + <td>shl rA,rB</td> |
| 229 | + <td colspan="8">27</td> |
| 230 | + <td colspan="5">rA</td> |
| 231 | + <td colspan="5">rB</td> |
| 232 | + <td colspan="46">PADDING</td> |
| 233 | + </tr> |
| 234 | + <tr> |
| 235 | + <td>shr rA,rB</td> |
| 236 | + <td colspan="8">28</td> |
| 237 | + <td colspan="5">rA</td> |
| 238 | + <td colspan="5">rB</td> |
| 239 | + <td colspan="46">PADDING</td> |
| 240 | + </tr> |
| 241 | + <tr> |
| 242 | + <td>sar rA,rB</td> |
| 243 | + <td colspan="8">29</td> |
| 244 | + <td colspan="5">rA</td> |
| 245 | + <td colspan="5">rB</td> |
| 246 | + <td colspan="46">PADDING</td> |
| 247 | + </tr> |
| 248 | + <tr> |
| 249 | + <td>add rA,rB</td> |
| 250 | + <td colspan="8">30</td> |
| 251 | + <td colspan="5">rA</td> |
| 252 | + <td colspan="5">rB</td> |
| 253 | + <td colspan="46">PADDING</td> |
| 254 | + </tr> |
| 255 | + <tr> |
| 256 | + <td>sub rA,rB</td> |
| 257 | + <td colspan="8">31</td> |
| 258 | + <td colspan="5">rA</td> |
| 259 | + <td colspan="5">rB</td> |
| 260 | + <td colspan="46">PADDING</td> |
| 261 | + </tr> |
| 262 | + <tr> |
| 263 | + <td>mult rA,rB</td> |
| 264 | + <td colspan="8">32</td> |
| 265 | + <td colspan="5">rA</td> |
| 266 | + <td colspan="5">rB</td> |
| 267 | + <td colspan="46">PADDING</td> |
| 268 | + </tr> |
| 269 | + <tr> |
| 270 | + <td>cmp rA,rB</td> |
| 271 | + <td colspan="8">33</td> |
| 272 | + <td colspan="5">rA</td> |
| 273 | + <td colspan="5">rB</td> |
| 274 | + <td colspan="46">PADDING</td> |
| 275 | + </tr> |
| 276 | + <tr> |
| 277 | + <td>mov rA,imm</td> |
| 278 | + <td colspan="8">44</td> |
| 279 | + <td colspan="5">rA</td> |
| 280 | + <td colspan="32">IMMEDIATE</td> |
| 281 | + <td colspan="19">PADDING</td> |
| 282 | + </tr> |
| 283 | + <tr> |
| 284 | + <td>not rA</td> |
| 285 | + <td colspan="8">51</td> |
| 286 | + <td colspan="5">rA</td> |
| 287 | + <td colspan="51">PADDING</td> |
| 288 | + </tr> |
| 289 | + <tr> |
| 290 | + <td>push rA</td> |
| 291 | + <td colspan="8">52</td> |
| 292 | + <td colspan="5">rA</td> |
| 293 | + <td colspan="51">PADDING</td> |
| 294 | + </tr> |
| 295 | + <tr> |
| 296 | + <td>pop rA</td> |
| 297 | + <td colspan="8">53</td> |
| 298 | + <td colspan="5">rA</td> |
| 299 | + <td colspan="51">PADDING</td> |
| 300 | + </tr> |
| 301 | + <tr> |
| 302 | + <td>int DISP</td> |
| 303 | + <td colspan="8">59</td> |
| 304 | + <td colspan="8">DISPLACEMENT</td> |
| 305 | + <td colspan="48">PADDING</td> |
| 306 | + </tr> |
| 307 | + <tr> |
| 308 | + <td>call DEST</td> |
| 309 | + <td colspan="8">60</td> |
| 310 | + <td colspan="32">DESTINATION</td> |
| 311 | + <td colspan="24">PADDING</td> |
| 312 | + </tr> |
| 313 | + <tr> |
| 314 | + <td>jump DEST</td> |
| 315 | + <td colspan="8">61</td> |
| 316 | + <td colspan="32">DESTINATION</td> |
| 317 | + <td colspan="24">PADDING</td> |
| 318 | + </tr> |
| 319 | + <tr> |
| 320 | + <td>jumpl DEST</td> |
| 321 | + <td colspan="8">62</td> |
| 322 | + <td colspan="32">DESTINATION</td> |
| 323 | + <td colspan="24">PADDING</td> |
| 324 | + </tr> |
| 325 | + <tr> |
| 326 | + <td>jumple DEST</td> |
| 327 | + <td colspan="8">63</td> |
| 328 | + <td colspan="32">DESTINATION</td> |
| 329 | + <td colspan="24">PADDING</td> |
| 330 | + </tr> |
| 331 | + <tr> |
| 332 | + <td>jumpg DEST</td> |
| 333 | + <td colspan="8">64</td> |
| 334 | + <td colspan="32">DESTINATION</td> |
| 335 | + <td colspan="24">PADDING</td> |
| 336 | + </tr> |
| 337 | + <tr> |
| 338 | + <td>jumpge DEST</td> |
| 339 | + <td colspan="8">65</td> |
| 340 | + <td colspan="32">DESTINATION</td> |
| 341 | + <td colspan="24">PADDING</td> |
| 342 | + </tr> |
| 343 | + <tr> |
| 344 | + <td>jumpe DEST</td> |
| 345 | + <td colspan="8">66</td> |
| 346 | + <td colspan="32">DESTINATION</td> |
| 347 | + <td colspan="24">PADDING</td> |
| 348 | + </tr> |
| 349 | + <tr> |
| 350 | + <td>jumpne DEST</td> |
| 351 | + <td colspan="8">67</td> |
| 352 | + <td colspan="32">DESTINATION</td> |
| 353 | + <td colspan="24">PADDING</td> |
| 354 | + </tr> |
| 355 | + <tr> |
| 356 | + <td>ret</td> |
| 357 | + <td colspan="8">76</td> |
| 358 | + <td colspan="56">PADDING</td> |
| 359 | + </tr> |
| 360 | + <tr> |
| 361 | + <td>hlt</td> |
| 362 | + <td colspan="8">77</td> |
| 363 | + <td colspan="56">PADDING</td> |
| 364 | + </tr> |
| 365 | + <tr> |
| 366 | + <td>nop</td> |
| 367 | + <td colspan="8">78</td> |
| 368 | + <td colspan="56">PADDING</td> |
| 369 | + </tr> |
| 370 | + |
| 371 | +</table> |
3 | 372 |
|
4 | 373 |
|
5 |
| - |
|
0 commit comments