{"id":674,"date":"2023-03-07T09:50:34","date_gmt":"2023-03-07T09:50:34","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/?page_id=674"},"modified":"2023-03-07T10:01:11","modified_gmt":"2023-03-07T10:01:11","slug":"fetch-execute-cycle","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/software-design-and-development\/week-9\/fetch-execute-cycle\/","title":{"rendered":"Fetch \/ execute cycle"},"content":{"rendered":"\n<p>The term fetch\/execute is used to describe the&nbsp;<strong>process of sending and receiving data to\/from the processor and memory<\/strong>&nbsp;(whether it be RAM (main memory) or cache).<\/p>\n\n\n\n<p>When a&nbsp;<strong>memory read operation&nbsp;<\/strong>occurs;<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>data is read from a memory address<\/li><li>it is then taken to the processor<\/li><\/ol>\n\n\n\n<p>When a&nbsp;<strong>memory write operation&nbsp;<\/strong>occurs:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>data is taken from the processor<\/li><li>it is then written to the memory<\/li><\/ol>\n\n\n\n<p>During the fetch\/execute cycle the&nbsp;<strong>control unit<\/strong>, data bus and address bus are all in use:<\/p>\n\n\n\n<p>the control unit will:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>dictate the clock speed of the fetch\/execute cycle<\/li><li>activate either the read or write line<\/li><\/ul>\n\n\n\n<p>the address bus will hold the address that is being accessed in main memory<\/p>\n\n\n\n<p>the data bus will either transfer the data contained the memory address to the processor, or will transfer data from the processor to the memory address<\/p>\n\n\n\n<p>The control unit clock line is active at all times, setting the pulse\/pace of the fetch\/execute cycle.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Memory read<\/h2>\n\n\n\n<p>The steps for a <strong>read <\/strong>operation are:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>MAR (Memory Address Register) sets up the address bus with the relevant memory location to be read from.<\/li><li>The control unit read line is activated<\/li><li>The contents of the address held on the address bus are placed on the data bus<\/li><li>The data bus transfers the data from memory to the MDR (memory Data Register)<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Example of a program being read<\/h3>\n\n\n\n<p>The memory address of the first instruction is placed on the address bus.<\/p>\n\n\n\n<p>A read signal is activated on the control bus and the data is transferred along the data bus to a register within the processor.<\/p>\n\n\n\n<p>The instruction is then decoded and executed.<\/p>\n\n\n\n<p>The process is repeated until the program is complete.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Memory write<\/h2>\n\n\n\n<p>The steps of a <strong>write <\/strong>operation are:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>MAR (Memory Address Register) sets up the address bus with the relevant memory location to be written to<\/li><li>MDR (Memory Data Register) passes the data to be written to the data bus<\/li><li>The control unit write line is activated<\/li><li>Data bus transfers the data to the memory location specified on the address bus<\/li><\/ol>\n\n\n\n<p>Think of it like the steps to sending an email.<\/p>\n\n\n\n<p>You type the email address that you want your message sent to.<\/p>\n\n\n\n<p>You type the messageof the email ready to be sent.<\/p>\n\n\n\n<p>You click the send button.<\/p>\n\n\n\n<p>The application and email servers deliver your message to the address you entered.<\/p>\n\n\n\n<p class=\"nextlink\"><a href=\"https:\/\/blogs.glowscotland.org.uk\/es\/software\/software-design-and-development\/week-9\/computer-system-performance\/\" data-type=\"page\" data-id=\"680\">Next: Computer system performance<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The term fetch\/execute is used to describe the&nbsp;process of sending and receiving data to\/from the processor and memory&nbsp;(whether it be RAM (main memory) or cache). When a&nbsp;memory read operation&nbsp;occurs; data is read from a memory address it is then taken to the processor When a&nbsp;memory write operation&nbsp;occurs: data is taken from the processor it is&hellip; <a class=\"more-link\" href=\"https:\/\/blogs.glowscotland.org.uk\/es\/software\/software-design-and-development\/week-9\/fetch-execute-cycle\/\">Continue reading <span class=\"screen-reader-text\">Fetch \/ execute cycle<\/span><\/a><\/p>\n","protected":false},"author":5710,"featured_media":0,"parent":30,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-674","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/users\/5710"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/comments?post=674"}],"version-history":[{"count":4,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/674\/revisions"}],"predecessor-version":[{"id":682,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/674\/revisions\/682"}],"up":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/30"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/media?parent=674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}