Basic Interview Questions on Computer Architecture

Aditya Garg 08 Sep, 2022 • 7 min read

This article was published as a part of the Data Science Blogathon.

Introduction

In this article, we will discuss some questions on Computer Architecture that are important from the perspective of interviews and college examinations.

Computer Architecture means how a computer is interconnected with its hardware components and how they transfer data. Various methods and hardware have increased these computers’ processing speed and efficiency.

History of Computers

1. Charles Babbage: Conceptualization and implementation of the first mechanical computer (1833). It contains 8000 parts, its weight is 5 tons, and its length is 11 feet

2. The first electronic digital programmable computer, Colossus, was invented in 1943. It uses Vacuum Tubes to process the information.

3. the First programmable electronic computer called ENIAC was invented in 1945. It weighs about 80 tons, and it contains about 18000 vacuum tubes.

Computer Architecture
Fig. 1 Basic Computer Architecture

Source – https://en.wikipedia.org/wiki/Von_Neumann_architecture

Why should we study Computer Architecture?

Below are some reasons why it is beneficial for us to gain knowledge of computer architecture. It helps us to write fast and efficient code. Also, it allows us to identify the proper hardware which fulfills our computational demands.

1. Write better programs

a) Faster

b) Smaller

c) Less power consuming (fewer computations involved)

2. To make suitable design choices for changing needs and evolving technologies

a) GPU

b) Wearable

c) Datacenter

d) Mobile phones

e) Quantum computing etc.

Outcomes of learning Computer Architecture:

1. Understanding of the essential components and the design of a computer,

2. Understanding the functional aspects of different components

3. Identification of the issues involved in the instruction execution

4. Identification and analysis of the issues related to performance improvement

5. Analysis of system requirements

Interview Questions on Computer Architecture

Q1. Explain the relative advantages and disadvantages of serial and parallel buses.

Serial Bus: It is a bus that transfers data bit by bit over a single channel. It periodically transmits data to avoid a collision.

Parallel Bus: It is a bus that parallelly transmits bits over multiple channels. As more than one channel is used, there is no chance of collision.

The table below shows the advantages and disadvantages of Serial Buses and Parallel Buses.

Advantages:

Serial Bus Parallel Bus
Serial mode offers the advantage of fewer traces on the pc board.  It transfers more bits per I/O cycle.
Less Cost.  It transfers data with more speed as compared to the serial bus.
It also has fewer pins, making it less complicated.  It has a high update rate, so it could be beneficial where the update rate of bits must be increased.
It gives the advantage of addressing single bytes in the device register.

Disadvantages:

Serial Bus Parallel Bus
Slower Rate of data transfer. More complexity on the motherboard due to more pins.
Slower bit update rate. Higher Cost
It requires all the bits of the multibyte register, which must be loaded one at a time. It only supports short-distance communication due to cross-talk between parallel lines.

Q2. Explain the significant differences between Von Neumann and Harvard architectures.

Von Neuman Architecture Harvard Architecture
This same memory is used for storing instructions and data. In this, separate memories are used for storing instructions and data.
Due to the single memory, it has a cheaper cost. Due to multiple memories, it has a higher cost.
The CPU can not simultaneously read and write the instructions and data as a single memory. Due to multiple memories, the CPU can read and write the instructions and data simultaneously.
We can commonly find Von-Neuman Architecture in personnel computers. Harvard Architecture is typical in microcontrollers and signal processing.

Below is the diagrammatic explanation of this two architecture

Computer Architecture

Fig. 2 Von Neumann V/S Harvard Architecture

 Source – https://www.polytechnichub.com/difference-harvard-architecture-von-neumann-architecture/harvard-architecture-and-von-neumann-architecture/

Q3. What is the stored program concept? How did it help in the advancement of computing?

The Stored Program Concept is similar to Von-Neuman Architecture. In this, both the instructions and data are stored in the same memory. And before this concept, the instructions and data are stored in two separate memories, entirely different entities (e.g., Harvard Architecture). Below is the figure which shows where this store program concept is used.

stored program concept

Source – https://www.javatpoint.com/store-program-control-concept

Advantages:
It only uses single memory, that’s why its manufacturing cost is significantly less. Also, a single data bus is used to fetch both data and instructions, which reduces its cost furthermore. By using this concept, we can sequentially perform various tasks. Also, it provides high processing power due to only a single memory.

Q4. Explain the role of the instruction set architecture as a layer of abstraction. How is system software different from application software?

Instruction set architecture acts as an interface between hardware and software. Provides commands to the processor to tell it what it needs to do. Instruction set architecture is the machine’s portion visible to the assembly language programmer. Also, it is the only way to interact with the hardware.

System Software Application Software
It is written in assembly language. It is written in High-Level Languages.
They are general-purpose software. They are made for specific purposes and functions.
They can run independently of application software. They need System Software to run.
It works as an interface between Application Software and System. It works as an interface between the Application Software and the User.
Users cannot interact with it. Users can interact with it and give them commands.
E.g., Operating Systems E.g., MS Word

 

Q5 “The clock rate of a computer may be arbitrarily increased to achieve faster execution by the CPU” – Do you agree with this statement? Explain.

No, we cannot increase the clock rate of a computer to a value to achieve high computations arbitrarily. Because improving the clock rate arbitrarily can increase the cost of the issues and lead to severe heating issues.
CPU execution time = (Number of instructions × CPI)(1/clock rate)

From the above equation, we can see that if the clock rate is inversely proportional, the execution time will decrease and vice-versa. If the pulse is high, given that the circuit is slow, it might be possible that the course is triggered by the next clock pulse, leading to the wrong result.

Q6. Is Moore’s Law still valid? Do you think that it will remain steadfast in the future? If not, what will be the possible reasons for its failure?

Moore’s Law is invalid nowadays because we cannot double the number of transistors every two years. According to a study, the growth rate of the number of transistors is less than 30% annually. Using standard silicon technology, computing power cannot maintain its rapid exponential growth.

In the future, the original Moore’s Law will not be valid. It will probably be replaced or modified according to the needs of quantum computation.

Reasons for the failure of Moore’s Law:

1. Currently, the transistors are soo small that we cannot reduce their size further. Now, Apple is making micro-chips of size 7nm, which is even minor in the thickness of hair.

2. The main reasons blocking Moore’s Law are Heating and Leakage.

3. Artificial Intelligence and Machine Learning have augmented Moore’s Law over time.

4. The upcoming era is Quantum Computing which has an entirely different structure and is based on nano-biotechnology. It will be the end of the silicon age.

Q7. Consider the following table.

Instruction Type
Frequency
Clock Cycles
ALU Instructions 50% 4
Load Instructions 30% 5
Store Instructions 10% 4
Branch Instructions 10% 2

1) Calculate CPI
2) Assume that the program contains three × 106 number of instructions. Find out the CPU execution time if the clock rate is 2 GHz.
3) Assume that we want to achieve an overall speedup of 1.5 by enhancing the ALU instructions. What is the necessary speedup for the ALU instructions? Consider that ALU instructions consist of additions only. Suggest two schemes for designing the primary circuits of such an ALU so that moving from the first method to the second leads to an enhancement.

Ans:

1) CPI is the average clock cycle required per instruction.

Therefore, CPI

= (50/100)×4 + (30/100)×5 + (10/100)×4 + (10/100)×2

= 4.1

2) CPU executing time = (No. of instructions)*CPI/frequency

Number of instructions = 3 × 106 {Given}

CPI = 4.1 {As calculated above}

Clock rate = 2 × 109 Hz {Given}

Therefore,

CPU execution time = (Number of instructions × CPI)(1/clock rate)

= (3 × 106 × 4.1)(1 / 2 × 109)

= 6.15 × 10-3s

3) Overall speedup (S0) = 1.5 {Given}

p = 0.5 {Given}

S = speedup {To find}

Further,

According to Amdahl’s Law, the Overall SpeedUp is given by-

S0 = 1(1 – p)+p/S                 {So is the overall speedup}

1.5 = 1(1 – 0.5)+(0.5/S)

Thus,

S = 3

Therefore, Speedup of ALU instruction is 3

In the first scheme, we will do the 1’s complement, but in the 2nd scheme, we will do the 2’s complement to increase the speed to the desired value.

Conclusion

In this article, we have discussed various essential questions about Computer Networks for Interview preparation.

There are also various topics in computer architecture, like the Arithmetic Logic Unit, which is responsible for all the arithmetic and logic operations on data processed by a computer. Also, the circuitry must be able to perform all the arithmetic and logic operations included in the instruction set.

Also, Control Units and Registers are some crucial topics I will discuss in subsequent blogs.

Currently, there is a massive demand for computer architecture engineers. So if you want to pursue this field, it is very high time. You get numerous resources online free of cost that will help you to master this skill.

Key takeaways from this article
1. Discussed Von Neuman and Harvard Architecture
2. Discussed Serial and Parallel Buses
3. Get deep insights into Moore’s Law
4. Talk about Clock Rate, System Software, and Application Software.

It is all for today. I hope that you have enjoyed reading that article.

See you again 😊

The media shown in this article is not owned by Analytics Vidhya and is used at the Author’s discretion.

Aditya Garg 08 Sep 2022

Frequently Asked Questions

Lorem ipsum dolor sit amet, consectetur adipiscing elit,

Responses From Readers

Clear