Question
Consider the evolution of computers in general and the increase in processor speed in particular. Suppose we had a system with a processor that is
Consider the evolution of computers in general and the increase in processor speed in particular. Suppose we had a system with a processor that is clocked at 4GHz. When we discuss gigahertz (GHz), megahertz (MHz), or just hertz (Hz) we are discussing frequency, which is the relationship between some repeated occurrence and time. For a processor, we say that we have some oscillator that is generating electrical pulses at some fixed rate over time, which is known as clock speed or clock rate. How frequently these pulses can be generated determines the clock speed of the processor. Further, each pulse allows for some instruction (storing data in a register, performing binary addition, etc.) to be performed on the CPU by the system, which is informally known as a cycle. You may hear cycles per second or instructions per second being used interchangeably when discussing processor speeds as the number of cycles indicates the number of instructions. So, when we consider the speed of a processor a frequency of 1Hz represents 1 cycle per second and thus 1 instruction per second, which is what could be expected from early computers. Processor speed has a major impact on system performance, and as CPUs become faster, we find that other parts of the computer become bottlenecks for the system. For example, while the CPU can perform calculation with data very quickly, it still needs access to the data! The longer it takes for data to arrive, the longer it takes for the calculations to be completed, which places some restrictions on how the physical components of the computer are positioned inside the computer and on the motherboard. To conceptualize this, lets consider the following situation. Lets say that we had a system with a fast processor, and that signals in our system can propagate across the connections on the motherboard at 90% of the speed of light. You will need to construct a program in C++ that will determine the maximum distance, in millimeters with three decimals of precision, between the CPU and Memory (or Cache) if we want to access data within one processor cycle. Keep in mind that to access data, a signal must be sent by the CPU to the memory unit and the data has to be returned.
Your C++ program should contain: Globally scoped, constant variable(s) for any known value(s) that will not change o No global or class scoped variables are allowed other than constant variables o Globally scoped variables should be stored in header files for ease of access A function which will: o Take in the processor speed as an argument o Calculate the distance in terms of millimeters o Return the distance o The function should be defined in a separate .cpp file with an associated header file A main function which will: o Prompt the user for the speed of the processor in terms of GHz with an appropriate message, and read in and store the value o Call the appropriate function to calculate the distance o Output that distance, with three decimal points of precision, to the user with an appropriate message. Be sure that variable data types are sufficient to hold very large or very small values
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started