Autosave: 2023-10-24 07:13:11

This commit is contained in:
thomasabishop 2023-10-24 07:13:11 +01:00
parent 9e39ee021a
commit 7ed220288b
5 changed files with 2 additions and 29 deletions

View file

@ -10,12 +10,12 @@ The ALU is the centerpiece or core of the [CPU](/Computer_Architecture/CPU/CPU_a
The ALU comprises [logic gates](/Electronics_and_Hardware/Digital_circuits/Logic_gates.md) that execute the instructions passed from memory and where the data stored by the registers is acted upon.
It executes arithmetic and logical operations on binary numbers and thus it is where you will find operations conducted by [full-adders and half adders](/Electronics_and_Hardware/Digital_circuits/Half_adder_and_full_adder.md) etc.
It executes arithmetic and logical operations on binary numbers and where you will find operations conducted by [full-adders and half adders](/Electronics_and_Hardware/Digital_circuits/Half_adder_and_full_adder.md) etc.
More specifically, the ALU is responsible for the _execute_ phase of the [fetch, decode, execute cycle](/Computer_Architecture/CPU/Fetch_decode_execute.md).
## ALU execution lifecycle
1. **Inputs**: The ALU receives two operands and a control signal as inputs. The operands are the data on which the operations will be performed. The control signal tells the ALU which operation it needs to perform.
2. **Perform operation**: The ALU carries out the requested operation. For instance, if the control signal indicates an addition operation, the ALU sums the two operancs.
2. **Perform operation**: The ALU carries out the requested operation. For instance, if the control signal indicates an addition operation, the ALU sums the two operands.
3. **Output**: The ALU then sends the operation to another part of the CPU for further processing or storage. The ALU also outputs a status bit that can be used by other parts of the CPU to make decisions. For instance if the additon results in a value that is too large to be stored, the ALU will set an overflow flag.

View file

@ -1,27 +0,0 @@
<svg width="131" height="42" viewBox="0 0 131 42" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.856689 0.601532H116C124.008 0.601532 130.5 7.0934 130.5 15.1015V41.2755H15.3567C7.34856 41.2755 0.856689 34.7836 0.856689 26.7755V0.601532Z" fill="white" stroke="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M33.087 21.2773C33.087 26.5227 28.8348 30.7749 23.5894 30.7749C18.344 30.7749 14.0918 26.5227 14.0918 21.2773C14.0918 16.0319 18.344 11.7796 23.5894 11.7796C28.8348 11.7796 33.087 16.0319 33.087 21.2773ZM35.2455 21.2773C35.2455 27.7147 30.0269 32.9333 23.5894 32.9333C17.1519 32.9333 11.9333 27.7147 11.9333 21.2773C11.9333 14.8398 17.1519 9.62122 23.5894 9.62122C30.0269 9.62122 35.2455 14.8398 35.2455 21.2773ZM17.9748 23.9709C21.4879 26.8157 26.5121 26.8157 30.0252 23.9709L28.6669 22.2934C25.9458 24.4969 22.0542 24.4969 19.3331 22.2934L17.9748 23.9709ZM19.4379 20.2773V17.3614H21.5963V20.2773H19.4379ZM26.1355 17.3614V20.2773H28.2939V17.3614H26.1355Z" fill="black"/>
<path d="M48.1256 22.1499C49.114 22.1499 49.921 22.4102 50.5468 22.9307C51.1784 23.4453 51.4942 24.3021 51.4942 25.5009V31.9398H48.9327V26.1238C48.9327 25.6208 48.8654 25.2348 48.7309 24.9658C48.4853 24.4746 48.0174 24.229 47.3274 24.229C46.4794 24.229 45.8975 24.5886 45.5817 25.3079C45.4179 25.6881 45.336 26.1735 45.336 26.7641V31.9398H42.8447V22.3956H45.2571V23.7903C45.5787 23.2991 45.8829 22.9453 46.1694 22.7289C46.6841 22.3429 47.3361 22.1499 48.1256 22.1499Z" fill="black"/>
<path d="M57.3811 30.1766C58.1121 30.1766 58.6735 29.9163 59.0653 29.3958C59.4572 28.8753 59.6531 28.1355 59.6531 27.1764C59.6531 26.2173 59.4572 25.4805 59.0653 24.9658C58.6735 24.4453 58.1121 24.1851 57.3811 24.1851C56.65 24.1851 56.0857 24.4453 55.688 24.9658C55.2962 25.4805 55.1003 26.2173 55.1003 27.1764C55.1003 28.1355 55.2962 28.8753 55.688 29.3958C56.0857 29.9163 56.65 30.1766 57.3811 30.1766ZM62.276 27.1764C62.276 28.58 61.8725 29.7818 61.0654 30.7818C60.2584 31.776 59.0332 32.2731 57.3898 32.2731C55.7465 32.2731 54.5213 31.776 53.7143 30.7818C52.9072 29.7818 52.5037 28.58 52.5037 27.1764C52.5037 25.7963 52.9072 24.6003 53.7143 23.5886C54.5213 22.5768 55.7465 22.071 57.3898 22.071C59.0332 22.071 60.2584 22.5768 61.0654 23.5886C61.8725 24.6003 62.276 25.7963 62.276 27.1764Z" fill="black"/>
<path d="M62.3732 24.2465V22.4657H63.7066V19.799H66.1804V22.4657H67.733V24.2465H66.1804V29.2993C66.1804 29.6912 66.2301 29.9368 66.3295 30.0362C66.4289 30.1298 66.733 30.1766 67.2418 30.1766C67.3178 30.1766 67.3968 30.1766 67.4786 30.1766C67.5664 30.1707 67.6512 30.1649 67.733 30.159V32.0275L66.5488 32.0714C65.3675 32.1123 64.5604 31.9076 64.1276 31.4573C63.8469 31.1707 63.7066 30.7292 63.7066 30.1327V24.2465H62.3732Z" fill="black"/>
<path d="M77.3896 22.1675C78.6469 22.1675 79.6294 22.6207 80.3371 23.5272C81.0505 24.4336 81.4073 25.6033 81.4073 27.0361C81.4073 28.5215 81.0564 29.7526 80.3546 30.7292C79.6528 31.7058 78.6733 32.1942 77.4159 32.1942C76.6264 32.1942 75.9919 32.0363 75.5123 31.7205C75.2258 31.5333 74.9158 31.2058 74.5825 30.738V31.9398H72.135V19.027H74.6263V23.6237C74.9421 23.1792 75.2901 22.84 75.6702 22.6061C76.1205 22.3137 76.6937 22.1675 77.3896 22.1675ZM76.7492 30.1327C77.3925 30.1327 77.8925 29.8724 78.2493 29.352C78.606 28.8315 78.7844 28.1472 78.7844 27.2992C78.7844 26.6209 78.6967 26.0594 78.5212 25.615C78.1879 24.7728 77.5738 24.3518 76.679 24.3518C75.7726 24.3518 75.1497 24.7641 74.8105 25.5887C74.6351 26.0273 74.5474 26.5945 74.5474 27.2905C74.5474 28.1092 74.7287 28.7876 75.0913 29.3256C75.4538 29.8637 76.0065 30.1327 76.7492 30.1327Z" fill="black"/>
<path d="M82.873 33.7732L83.1888 33.7907C83.4344 33.8024 83.6683 33.7936 83.8905 33.7644C84.1128 33.7352 84.2999 33.6679 84.452 33.5626C84.5982 33.4632 84.7327 33.2556 84.8555 32.9398C84.9841 32.624 85.0368 32.431 85.0134 32.3608L81.5045 22.378H84.2853L86.3731 29.4309L88.3468 22.378H91.0048L87.724 31.7819C87.0924 33.5948 86.5924 34.7177 86.224 35.1504C85.8555 35.589 85.1187 35.8083 84.0134 35.8083C83.7911 35.8083 83.6128 35.8054 83.4782 35.7996C83.3437 35.7996 83.142 35.7908 82.873 35.7733V33.7732Z" fill="black"/>
<path d="M97.5372 27.0536H100.818L99.204 21.9657L97.5372 27.0536ZM97.7039 19.0095H100.757L105.336 31.9398H102.406L101.572 29.2818H96.8091L95.9144 31.9398H93.0897L97.7039 19.0095Z" fill="black"/>
<path d="M110.323 31.9398H107.639V19.0095H110.323V31.9398Z" fill="black"/>
<path d="M106.046 19.0095H111.731V21.2089H106.046V19.0095Z" fill="black"/>
<path d="M106.046 29.7433H111.731V31.9428H106.046V29.7433Z" fill="black"/>
<path d="M42.8772 9.65324L43.8897 13.8016L44.917 9.65324H45.9098L46.942 13.777L48.0184 9.65324H48.9031L47.3745 14.9173H46.4554L45.3839 10.8427L44.3468 14.9173H43.4277L41.9089 9.65324H42.8772Z" fill="black"/>
<path d="M49.6675 9.65324H50.508V10.5625C50.5768 10.3856 50.7455 10.171 51.0142 9.91865C51.2829 9.66307 51.5926 9.53527 51.9432 9.53527C51.9596 9.53527 51.9874 9.53691 52.0267 9.54019C52.0661 9.54347 52.1332 9.55002 52.2283 9.55985V10.4937C52.1758 10.4839 52.1267 10.4773 52.0808 10.4741C52.0382 10.4708 51.9907 10.4691 51.9383 10.4691C51.4926 10.4691 51.1502 10.6133 50.911 10.9017C50.6718 11.1867 50.5522 11.5161 50.5522 11.8896V14.9173H49.6675V9.65324Z" fill="black"/>
<path d="M52.8944 9.67781H53.7938V14.9173H52.8944V9.67781ZM52.8944 7.69703H53.7938V8.69971H52.8944V7.69703Z" fill="black"/>
<path d="M55.2119 8.18362H56.1065V9.65324H56.9469V10.3758H56.1065V13.8114C56.1065 13.9949 56.1687 14.1178 56.2932 14.18C56.3621 14.2161 56.4767 14.2341 56.6373 14.2341C56.6799 14.2341 56.7258 14.2341 56.7749 14.2341C56.8241 14.2308 56.8814 14.2259 56.9469 14.2194V14.9173C56.8454 14.9468 56.7389 14.9681 56.6275 14.9812C56.5193 14.9943 56.4014 15.0009 56.2736 15.0009C55.8607 15.0009 55.5806 14.896 55.4331 14.6863C55.2856 14.4733 55.2119 14.1981 55.2119 13.8606V10.3758H54.4992V9.65324H55.2119V8.18362Z" fill="black"/>
<path d="M57.9129 8.18362H58.8074V9.65324H59.6479V10.3758H58.8074V13.8114C58.8074 13.9949 58.8697 14.1178 58.9942 14.18C59.063 14.2161 59.1777 14.2341 59.3382 14.2341C59.3808 14.2341 59.4267 14.2341 59.4759 14.2341C59.525 14.2308 59.5824 14.2259 59.6479 14.2194V14.9173C59.5463 14.9468 59.4398 14.9681 59.3284 14.9812C59.2203 14.9943 59.1023 15.0009 58.9745 15.0009C58.5617 15.0009 58.2815 14.896 58.134 14.6863C57.9866 14.4733 57.9129 14.1981 57.9129 13.8606V10.3758H57.2002V9.65324H57.9129V8.18362Z" fill="black"/>
<path d="M62.629 9.53527C63.0025 9.53527 63.3646 9.62375 63.7152 9.80069C64.0658 9.97436 64.3329 10.2004 64.5164 10.479C64.6933 10.7444 64.8113 11.054 64.8703 11.4079C64.9227 11.6504 64.9489 12.0371 64.9489 12.5679H61.0906C61.107 13.102 61.2331 13.5312 61.469 13.8556C61.705 14.1768 62.0703 14.3373 62.5651 14.3373C63.0271 14.3373 63.3957 14.1849 63.671 13.8802C63.8283 13.7033 63.9397 13.4985 64.0052 13.2658H64.8752C64.8522 13.4592 64.7752 13.6754 64.6442 13.9146C64.5164 14.1505 64.3722 14.3439 64.2116 14.4946C63.943 14.7567 63.6104 14.9337 63.2139 15.0254C63.0009 15.0779 62.7601 15.1041 62.4914 15.1041C61.836 15.1041 61.2806 14.8665 60.8252 14.3914C60.3697 13.913 60.142 13.2445 60.142 12.386C60.142 11.5406 60.3713 10.8542 60.8301 10.3266C61.2888 9.79905 61.8884 9.53527 62.629 9.53527ZM64.0396 11.865C64.0036 11.4816 63.92 11.1753 63.7889 10.9459C63.5465 10.5199 63.1418 10.3069 62.5749 10.3069C62.1686 10.3069 61.8278 10.4544 61.5526 10.7493C61.2773 11.0409 61.1315 11.4128 61.1151 11.865H64.0396Z" fill="black"/>
<path d="M65.9394 9.65324H66.7799V10.4003C67.0289 10.0923 67.2927 9.87114 67.5712 9.73679C67.8497 9.60245 68.1594 9.53527 68.5002 9.53527C69.2473 9.53527 69.7519 9.79577 70.014 10.3168C70.1582 10.6018 70.2303 11.0098 70.2303 11.5406V14.9173H69.3308V11.5996C69.3308 11.2785 69.2833 11.0196 69.1883 10.823C69.031 10.4954 68.7459 10.3315 68.333 10.3315C68.1233 10.3315 67.9513 10.3528 67.817 10.3954C67.5745 10.4675 67.3615 10.6117 67.178 10.8279C67.0306 11.0016 66.9339 11.1818 66.888 11.3686C66.8454 11.5521 66.8241 11.8159 66.8241 12.1599V14.9173H65.9394V9.65324Z" fill="black"/>
<path d="M74.0741 7.67245H74.9342V10.2922C75.1275 10.0399 75.3586 9.8482 75.6272 9.71713C75.8959 9.58279 76.1876 9.51561 76.5021 9.51561C77.1575 9.51561 77.6883 9.74171 78.0946 10.1939C78.5042 10.6428 78.709 11.3063 78.709 12.1845C78.709 13.0168 78.5075 13.7082 78.1044 14.2587C77.7014 14.8092 77.1427 15.0844 76.4284 15.0844C76.0286 15.0844 75.6911 14.9877 75.4159 14.7944C75.2521 14.6797 75.0768 14.4962 74.89 14.2439V14.9173H74.0741V7.67245ZM76.3743 14.3029C76.8527 14.3029 77.2099 14.1129 77.4458 13.7328C77.685 13.3527 77.8046 12.8513 77.8046 12.2287C77.8046 11.675 77.685 11.2162 77.4458 10.8525C77.2099 10.4888 76.8609 10.3069 76.3989 10.3069C75.9959 10.3069 75.642 10.456 75.3373 10.7542C75.0358 11.0524 74.8851 11.5439 74.8851 12.2287C74.8851 12.7235 74.9473 13.1249 75.0718 13.4329C75.3045 14.0129 75.7387 14.3029 76.3743 14.3029Z" fill="black"/>
<path d="M82.9336 9.65324H83.9117C83.7872 9.99074 83.5103 10.7608 83.0811 11.9633C82.76 12.8677 82.4913 13.605 82.275 14.1751C81.7638 15.5186 81.4034 16.3378 81.1937 16.6327C80.984 16.9276 80.6235 17.075 80.1124 17.075C79.9878 17.075 79.8912 17.0701 79.8224 17.0603C79.7568 17.0504 79.6749 17.0324 79.5766 17.0062V16.2001C79.7306 16.2427 79.842 16.2689 79.9108 16.2788C79.9797 16.2886 80.0403 16.2935 80.0927 16.2935C80.2565 16.2935 80.3761 16.2657 80.4515 16.21C80.5301 16.1575 80.5957 16.092 80.6481 16.0134C80.6645 15.9872 80.7235 15.8528 80.8251 15.6103C80.9266 15.3678 81.0004 15.1876 81.0462 15.0697L79.0999 9.65324H80.1025L81.5132 13.9392L82.9336 9.65324Z" fill="black"/>
<path d="M87.2788 7.67245H88.1635V10.3659C88.3732 10.1005 88.5616 9.91374 88.7287 9.8056C89.0138 9.61883 89.3693 9.52544 89.7953 9.52544C90.5588 9.52544 91.0765 9.7925 91.3485 10.3266C91.4959 10.6182 91.5696 11.0229 91.5696 11.5406V14.9173H90.6603V11.5996C90.6603 11.213 90.6112 10.9295 90.5129 10.7493C90.3523 10.4609 90.0509 10.3168 89.6085 10.3168C89.2415 10.3168 88.9089 10.4429 88.6107 10.6952C88.3126 10.9475 88.1635 11.4243 88.1635 12.1255V14.9173H87.2788V7.67245Z" fill="black"/>
<path d="M93.666 9.65324V13.1479C93.666 13.4166 93.7086 13.6361 93.7938 13.8065C93.9511 14.1211 94.2444 14.2783 94.6736 14.2783C95.2896 14.2783 95.7091 14.0031 95.9319 13.4526C96.0531 13.1577 96.1137 12.753 96.1137 12.2386V9.65324H96.9984V14.9173H96.1629L96.1727 14.1407C96.058 14.3406 95.9155 14.5093 95.7451 14.647C95.4076 14.9222 94.998 15.0598 94.5163 15.0598C93.766 15.0598 93.2548 14.8092 92.9828 14.3078C92.8354 14.0391 92.7616 13.6803 92.7616 13.2314V9.65324H93.666Z" fill="black"/>
<path d="M98.2838 9.65324H99.1587V10.4003C99.3684 10.1415 99.5585 9.95306 99.7289 9.83509C100.021 9.63521 100.351 9.53527 100.722 9.53527C101.141 9.53527 101.479 9.63849 101.734 9.84492C101.878 9.96289 102.009 10.1366 102.127 10.3659C102.324 10.0841 102.555 9.87605 102.82 9.74171C103.086 9.60409 103.384 9.53527 103.715 9.53527C104.423 9.53527 104.904 9.79086 105.16 10.302C105.298 10.5773 105.366 10.9475 105.366 11.4128V14.9173H104.447V11.2605C104.447 10.9099 104.359 10.669 104.182 10.538C104.008 10.4069 103.795 10.3413 103.543 10.3413C103.196 10.3413 102.896 10.4577 102.644 10.6903C102.394 10.923 102.27 11.3113 102.27 11.8552V14.9173H101.371V11.4816C101.371 11.1245 101.328 10.864 101.243 10.7002C101.108 10.4544 100.858 10.3315 100.491 10.3315C100.156 10.3315 99.8518 10.4609 99.5765 10.7198C99.3045 10.9787 99.1686 11.4472 99.1686 12.1255V14.9173H98.2838V9.65324Z" fill="black"/>
<path d="M107.247 13.5165C107.247 13.7721 107.34 13.9736 107.527 14.1211C107.714 14.2685 107.935 14.3422 108.19 14.3422C108.502 14.3422 108.803 14.2701 109.095 14.126C109.586 13.8868 109.832 13.4952 109.832 12.9513V12.2386C109.724 12.3074 109.585 12.3647 109.414 12.4106C109.244 12.4565 109.077 12.4892 108.913 12.5089L108.377 12.5777C108.056 12.6203 107.815 12.6875 107.655 12.7792C107.383 12.9332 107.247 13.179 107.247 13.5165ZM109.39 11.7274C109.593 11.7012 109.729 11.616 109.798 11.4718C109.837 11.3932 109.857 11.2801 109.857 11.1327C109.857 10.8312 109.748 10.6133 109.532 10.479C109.319 10.3413 109.013 10.2725 108.613 10.2725C108.151 10.2725 107.823 10.3971 107.63 10.6461C107.522 10.7837 107.451 10.9885 107.419 11.2605H106.593C106.609 10.6117 106.819 10.1611 107.222 9.90882C107.628 9.65324 108.099 9.52544 108.633 9.52544C109.252 9.52544 109.755 9.64341 110.142 9.87933C110.525 10.1153 110.717 10.4822 110.717 10.9803V14.0129C110.717 14.1047 110.735 14.1784 110.771 14.2341C110.81 14.2898 110.89 14.3177 111.012 14.3177C111.051 14.3177 111.095 14.316 111.144 14.3127C111.193 14.3062 111.246 14.298 111.302 14.2882V14.9419C111.164 14.9812 111.059 15.0058 110.987 15.0156C110.915 15.0254 110.817 15.0303 110.692 15.0303C110.387 15.0303 110.166 14.9222 110.029 14.7059C109.956 14.5913 109.906 14.4291 109.876 14.2194C109.696 14.4553 109.437 14.6601 109.1 14.8337C108.762 15.0074 108.39 15.0942 107.984 15.0942C107.496 15.0942 107.096 14.9468 106.785 14.6519C106.477 14.3537 106.323 13.9818 106.323 13.5362C106.323 13.0479 106.475 12.6695 106.78 12.4008C107.084 12.1321 107.484 11.9666 107.979 11.9043L109.39 11.7274Z" fill="black"/>
<path d="M112.071 9.65324H112.911V10.4003C113.16 10.0923 113.424 9.87114 113.703 9.73679C113.981 9.60245 114.291 9.53527 114.632 9.53527C115.379 9.53527 115.883 9.79577 116.145 10.3168C116.29 10.6018 116.362 11.0098 116.362 11.5406V14.9173H115.462V11.5996C115.462 11.2785 115.415 11.0196 115.32 10.823C115.162 10.4954 114.877 10.3315 114.465 10.3315C114.255 10.3315 114.083 10.3528 113.948 10.3954C113.706 10.4675 113.493 10.6117 113.309 10.8279C113.162 11.0016 113.065 11.1818 113.019 11.3686C112.977 11.5521 112.956 11.8159 112.956 12.1599V14.9173H112.071V9.65324Z" fill="black"/>
</svg>

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB