1 / 6

CPU

Control Unit. O U T P U T. Main memory. I N P U T. . Compiler. . Compiler. OS. ฯ OS. ALU. CPU. Control Unit. . O U T P U T. . Main memory. . OUTPUT. Data. . Binary Program. I N P U T. Data. . . Program. . Program. Compiler. OS. ALU. .

smitherin
Download Presentation

CPU

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Control Unit O U T P U T Main memory I N P U T  Compiler  Compiler OS ฯOS ALU CPU

  2. Control Unit  O U T P U T  Main memory  OUTPUT Data  Binary Program I N P U T Data   Program  Program Compiler OS ALU  CPU

  3. Central Processing Unit (CPU) CPU performs the actual processing of information stored in memory. This information can be data or instructions for executing data. The CPU also store the results of those manipulations back in memory for later use. CPU consists of the following components 1. Control Unit (CU) : CU coordinates all activities of the computer by determining which operations should be carried out. The CU then transmits coordination control signals to the ALU. 2. Arithmetic-Logic Unit(ALU) : ALU consists of electronic circuitry to perform arithmetic operations (addition, subtraction, multiplication, and division) and to make comparisons (<, >, <=, >=, !=, ==). The CU copies the program instructions from memory into ALU that performs the operation specified by these instructions on data that are also copied from memory into ALU, and the computational results are copied to memory. cont 

  4. Central Processing Unit (CPU)…cont 3. Main Memory (RAM) : Random Access Memory stores information of all types: instructions, data, … etc. Computer’s memory are an ordered sequence of storage locations called memory cells. To be able to store or retrieve information kept in Main Memory, we must have some way to identify the individual memory cells. Each memory cell has a unique address associated with it. Whenever new information is placed in a memory cell, any existing contents is destroyed (the existing content always be overwritten by the new one.)

  5. public static void Main(string[] args) { const double payrate = 200.50; int hrs; double wage; Console.Write("Please input hour work: "); hrs = int.Parse(Console.ReadLine()); wage = hrs * payrate; Console.WriteLine("If you work {0} hours, wage = {1:F2}",hrs, wage); } Declaration Part Program Body Main Memory Please input hour work: 35 If you work 35 hours, wage = 7017.50 200.50 35 7017.50 payrate hrs wage

  6. Constant Declaration public static void Main(string[] args) { const int N = 5; double sum = 0; int k = 1; double num; Console.WriteLine("Please enter numbers :"); while (k <= N) { num = double.Parse(Console.ReadLine()); sum = sum + num; k = k+1; } Console.WriteLine("Summation = {0} ",sum); Console.ReadLine(); } Variable Declaration with initial value Variable Declaration no initial value Program Body

More Related