Tuesday, 29 December 2015

RISC vs CISC

The world of microprocessors can be divided into two parts- complex instruction set computing using CISC processors and reduced instruction set computing using RISC processors. Both seek to improve the performance of a processor in terms of speed of execution, silicon area covered and power dissipated, but using different approaches.


Introduction


Earlier processor's instruction set architecture contains simple instructions like an addition of two operands. As the processors became more complex, so did their ISA. New instructions were added which were equivalent to multiple simple instructions. Current CISC microprocessors may contain over 300 instructions. Generating control signals for these instructions require equally complex control logic, having large propagation delay. This put the upper limit on the maximum frequency of the clock.


These limitations led designers to eliminate some rarely used instructions. According to them, the propagation delay within the processor would allow it to run at a higher frequency, thus performing each instruction more quickly.
However, in this alternative design tradeoff exists. Complex instructions in RISC are implemented by multiple simple instructions which take greater memory.



Differences between RISC and CISC processor

  • RISC processor has fewer and simpler instructions than CISC
  • Instructions are of fixed length in RISC. In CISC they are of variable length, making its instruction decoder more complex.
  • RISC processors have less number of addressing modes than CISC
  • Control unit of RISC is less complex and easier to design than that of CISC processor. So, the silicon area covered by the control logic of RISC processor is less than that of CISC. The area saved in RISC is used for registers and other components.


Which one is better- CISC or RISC?

Earlier researchers believed that RISC processors will ultimately replace CISC in future. Some said that both of them will co-exist. However, today's modern chip families like PowerPC microprocessors draw some features from RISC methodology and others from CISC, making them a hybrid of RISC and CISC. 

IBM PowerPC 601 processor



So, features of both CISC and RISC are present in today's chips and there is no right answer to the question regarding which one of them is better. 

Friday, 25 December 2015

Layers of abstraction in computing technology

Designing the computing devices is a fairly complex task. One way of solving tough problem is to divide it into several less enigmatic one. On that principle, computer scientist and engineers have created layers of abstractions of the computing system. The purpose of this is to understand the computing system in a systemic manner and to divide the work among various experts so that a high-performance system can be made.

Following are the components of computing system's layers of abstraction:-


1) Transistors

In this layer, researchers focus on making small, easy to fabricate, fast operation and with robust functionality transistors. Nowadays, MOSFET( Metal Oxide Semiconductor Field Effect transistor) are extensively used as they meet those criteria. Researchers are trying to reduce the size of MOSFET in order to keep Moore's Law valid but are now facing challenges due to phenomena like tunneling effect.


Types of MOSFETs- nMOS & pMOS

You can click here to watch a video on working of the MOSFET.


2) Logic gates

A logic gate is an elementary building block of any digital circuit. They are implemented by transistors, mainly MOSFETs. Today, logic gates are implemented by CMOS(Complementary MOS) among others methods. CMOS contains both pMOS and nMOS.
The main advantage of CMOS is that they dissipate zero static power. Static power is dissipated when logic gate contain stable value (either logic 1 or logic 0).

However, CMOS implementation uses a large number of transistors and can cover a greater area of silicon for complex circuits.



Some standard two-input logic gates



3) Combinational logic

Combinational logic is a digital circuit which consists of logic gates whose outputs at any time are determined from only the present combination of inputs. They are used for code conversion (for instance- binary to BCD) and for implementing arithmetic logic among other applications.

Block diagram of combinational circuit

Examples of standard combinational logic are Multiplexer, demultiplexer, encoder, decoder, adder and subtractor to name a few.


4) Sequential logic

Sequential logics is the digital circuit whose outputs at any time depends on previous output other than present input combination.
Most of the circuits in any microprocessor is sequential logic. Examples of sequential circuits are counter, flip-flops, Finite state machines.

Block diagram of sequential logic


5) Microarchitecture

Microarchitecture of any microprocessor is the way of implementation of instruction set architecture. It contains information regarding how many instructions to fetch from memory at a time, how to handle branch instructions, how to handle any instruction dependency.

Nowadays microprocessors use several concepts of microarchitecture like instruction pipelining, branch predictor, cache coherence protocols, superscalar processor, data level parallelism and many more.
The main aim is to execute as many instructions in a given time without compromising on silicon area covered and power dissipated.



6) Instruction set architecture

Instruction set architecture( ISA) serves as the boundary between software and hardware. An ISA is analogous to human language. It allows the hardware and software to communicate. Like any good language, it should be unambiguous and clear. It tells us about addressing mode, types of instructions and memory instructions.

A good ISA contains simple instructions which are often used. In the case of complex instructions like sorting an array, these simple instructions are used in a particular order.

Today's PC and laptop's microprocessors use x86 ISA and smartphone's processors use the ARM ISA.



7) Assembly language

The instructions given in ISA are stored as binary numbers in the instruction memory. Programming in machine language is tedious and prone to errors. This led to the development of assembly language. It uses mnemonics instead of binary representation for each instruction.Instructions in assembly language have a particular format, which should be followed by the programmers for correct execution of their code.

The program written in assembly language is converted into machine language by a program called assembler. 


8) High-level languages

Programming in assembly language is still cumbersome. The programmer needs to know the ISA of the target machine, which was getting complex as the computing world began to develop. In order to solve this problem, high-level programs were developed. A program called compiler converts the program in the high-level language into machine language.

There are many high-level languages to choose from- C, C++, Python, Java, C#.


C and C++ are one of the popular computer languages today.

Wednesday, 23 December 2015

Difference between microcontroller and microprocessor

Often microprocessors and microcontrollers are used interchangeably. But there are some fundamental differences between them.

Microprocessors


  • Contain just one or more Central Processing Units (CPU) with cache memory
  • Peripherals like RAM and ROM are outside the processor
  • Used in machines which perform different kinds of  functions in smartphones and laptops
  • Example-Intel Pentium

Intel Pentium 4


Microcontrollers

  • Contain CPU, fixed amount of RAM and ROM. 
  • Used in machines which are used for specific applications like in traffic lights, automobiles, washing machine, TV remote
  • Example- 8085
8085 microcontroller



In this blog, when I mention microchip, I will be referring to the microprocessor if not stated otherwise explicitly.








Ubiquitous chips

The purpose of this post to make you appreciate the omnipresence and usefulness of microchips in our life. Here are some of the gadgets which have become an inseparable part of our life. Following are some of the devices which we use without thinking about its brain.


 1) Laptops



There is a high probability that you are reading this post in your laptop or PC. It has become an integral part of our home and workplace.
There are two major companies who design microprocessors for laptops and PC- Intel and AMD. 



i) Intel Core i7











ii) AMD Athlon X2















2) Smartphones






Every year millions of smartphones are sold all over the world. The market is characterised by cut-throat competition and  follows the innovate-or-perish law. The computing power has grown exponentially and led to the birth of growing app industry. Qualcomm is the largest designer of smartphone chip and its suite of SoC(system-on-a-chip) Snapdragon is present in smartphones of Samsung, Microsoft, Sony, HTC to name a few.







 Qualcomm Snapdragon 820






3) Gaming consoles



PlayStation 4


Video games have evolved from Pac-Man in the 1980s to Call of Duty today. The graphics and overall user-experience have been enhanced. This is mainly due to powerful hardware and software.





Die of Cell processor, which is inside PlayStation gaming consoles. 







4) Server



Servers are machines responsible for hosting web pages, maintaining database and sharing of resources. You are viewing this blog because your device sent a request to the web server and in return server sent you the information.
Intel Xeon is the well-known server chip used in millions of servers today.




Intel Xeon 5500












About this blog





I am sure like me, many of you have been fascinated by microchips in laptops, smartphones and calculators. Microchips are the brain of these devices. Though there are many differences between our brain and these microchips, there are some similarities.
Our brain has some specific regions for logical thinking, for important involuntary actions like the beating of heart and breathing and for controlling our voluntary actions like walking, running & eating.
Likewise, there are some specific parts responsible for instruction and data storage, another for memory operation and arithmetic operations.
In fact, IBM has made a chip- TrueNorth, whose working is inspired by the biological brain.

Each chip has its own techniques to improve its performance because each one has its own requirements. The one used in gaming console need to execute different kind of instructions than microchip used in smartphones.
However, there are some common techniques used like instruction pipelining, data level parallelism, instruction level parallelism among many others, which will be discussed in this blog one-by-one.