{"id":138,"date":"2022-05-10T17:39:57","date_gmt":"2022-05-10T16:39:57","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/?page_id=138"},"modified":"2022-05-10T17:41:03","modified_gmt":"2022-05-10T16:41:03","slug":"fetch-and-execute","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/fetch-and-execute\/","title":{"rendered":"Fetch and Execute"},"content":{"rendered":"<p>When a program is running, it&#8217;s instructions are held in storage location in the memory.\u00a0 The processor starts with the first instruction and repeats the following stages until the program ends.<\/p>\n<ol>\n<li>Address of instructions are placed on the address bus<\/li>\n<li>Contents of locations (instruction&#8217;s) are transferred to a register along the data bus<\/li>\n<li>The instructions are decoded and executed<\/li>\n<\/ol>\n<h3>This is known as the fetch and execute cycle<\/h3>\n<h3>Example<\/h3>\n<p>number=int(input(&#8220;Please enter a number&#8221;)<\/p>\n<p><strong>Address bus<\/strong> &#8211; holds the address in memory where the instructions are stored.<\/p>\n<p><strong>Data bus<\/strong> &#8211; transfers the instructions from the memory to the registers within the processor.<\/p>\n<p><strong>Control Unit<\/strong> &#8211; executes the instructions by requesting input, receives input value from keyboard and temporary stores value in the register.<\/p>\n<p><strong>Address Bus &#8211;<\/strong> holds memory location address of number variable<\/p>\n<p><strong>Data bus<\/strong> &#8211; transfers value from registers to memory locations<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When a program is running, it&#8217;s instructions are held in storage location in the memory.\u00a0 The processor starts with the first instruction and repeats the following stages until the program ends. Address of instructions are placed on the address bus Contents of locations (instruction&#8217;s) are transferred to a register along the data bus The instructions [&hellip;]<\/p>\n","protected":false},"author":79984,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-138","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages\/138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/users\/79984"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/comments?post=138"}],"version-history":[{"count":4,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages\/138\/revisions"}],"predecessor-version":[{"id":142,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages\/138\/revisions\/142"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/media?parent=138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}