Intorduction To Computer

A computer is a multipurpose electronic device that can receive, process and store data

Digital Logic

Digital, or boolean, logic is the fundamental concept underpinning all modern computer systems.

Digital Logic Simulator

A logic simulator is a computer program that allows designers and experimenters to conduct virtual tests of complex digital circuitry before working with any hardware

MIPS(Microprocessor without Interlocked Pipeline Stages)

MIPS or Microprocessor without Interlocked Pipeline Stages is a reduced instruction set computer (RISC) instruction set architecture The first commercial MIPS model, R2000 was announced in 1985.

MIPS(Microprocessor without Interlocked Pipeline Stages) Simulator

SPIM is a MIPS processor simulator, designed to run assembly language code for this architecture. The program simulates R2000 and R3000 processors, and was written by James R. Larus while a professor at the University of Wisconsin-Madison.

Language of the Computers

Introduction - Assembly Language The basic job of a CPU,its excute lots of instructions.The set of instructions a particular CPU implements is an Instruction Set Architecture (ISA),few examples: 1) Intel 80x86 (Pentium 4) 2)IBM/Motorola 3)PowerPc (old Macintosh) 4)MIPs 5)Intel IA64 Different CPU implement different sets of instructions.

The Processor

Introduction - A processor is the logic circuitry that responds to and processes the basic instructions that drive a computer. The four primary functions of a processor are fetch, decode, execute and writeback.

Memory Organization

Introduction -A memory or a data byte, or a word, or a double word, or a quad word may be accessed from or at all addressable locations with a similar process would be used to access from all locations and there is would be equal access time for a read or for a write that is independent of a memory address location.

Input and Ouput

In this blog I will discuss on input/output procedures and devices .External device are not generally connected directly int the bus structure of the computer.I/O module is an interface for the external devices (peripherals) to CPU and memory.

Parallel Processing

Introduction to Parallel Processing - In computers, parallel processing is the processing of program instructions by dividing them among multiple processors with the objective of running a program in less time. - In the earliest computers, only one program ran at a time.

Showing posts with label CHAPTER 6. Show all posts
Showing posts with label CHAPTER 6. Show all posts

Wednesday, 7 December 2016

Assembly Variables : Registers and Arithmetic Operations

Assembly Variables : Registers

Unlike high level language like C++ or Java,assembly cannot use variable because to keep hardware simple.
- Assembly Operands are Registers
                - Limited number of special locations built directly into the hardware.
                - Operation can only be performed on Registers.
- Benefit
                1) Since registers are directly in hardware,they are very fast(faster than 1 bilionth of a
                      second).
- Drawback
                1) Since registers are in hardware,there are a predetermined number of them.
                               - Solution : MIPS code must be very carefully put together to efficiently use                                                             registers.
- There are 32 registers in MIPS,because smaller is faster.Each MIPS registers is 32 bits wide.Groups          of 32 bits called a word in MIPS.

Arithmetic Operations

- Add and subtract, three operands.
                - Two sources and one destinations.

- All arithmetic operations have this form

- Design Principle 1 : Simplicity Favours regularity
                1) Regularity makes implementation simpler.
                2) Simplicity enables higher performance at lower cost.


- Registers are numbered from 0 to 31

- Each register can be referred to by number or name.

- $0,$1,$2….until $31

- By convention,each register also has a name to make it easier to code.

- In Assembly Language, The register have no type.Operation determines how register contents are treated.

- Comments in assembly,hash(#) is used for MIPS comments
                1) anything from hash mark to end of line is a comment an will be ignored.

- In assembly language,each statement, excutes exactly one of a short list of simple commands.

MIPS Addition and Subtraction

- Syntax of Instructions:

1  2,3,4

where :
1) Operation by name.
2)Operand getting result(destination).
3)1st Operand for operation(source 1).
4) 2nd Operand for operation(soruce 2).

- Syntax is rigid
                1) 1 operator , 3 operands.
                2) Because to keep hardware simple via regularity.

- Addition in Assembly
                1) example: add  $s0, $s1, $s2(in MIPS).
                2) Equivalent to: a = b + c(in C).
                3)Where MIPS registers $s0, $s1, $s2 are associated with C variables a,b,c.


- Subtraction in Assembly
                1) example: sub  $s3, $s4, $s5(in MIPS).
                2) Equivalent to: d = e - f(in C).
                3)Where MIPS registers $s3, $s4, $s5 are associated with C variables d,e,f.

Language of the Computer

Introduction

- Assembly Language

The basic job of a CPU,its excute lots of instructions.The set of instructions a particular CPU implements is an Instruction Set Architecture (ISA),few examples:

1) Intel 80x86 (Pentium 4)
2)IBM/Motorola
3)PowerPc (old Macintosh)
4)MIPs
5)Intel IA64

Different CPU implement different sets of instructions.More primitive than higher level languages.No sophisticated control flow such as while for loops.their design goals is maximize performance and minimize cost and reduce design time.

- Instrunction Set Architectures

ISA includes:
                1) instructions set.
                2) Rules for using instructions:
                               - Mnemonics,functionality,addressing modes.
                3) Instruction encoding.

Early trend(instructions) was to add more and more instructions to new CPU to do elaborate operations.Early trend is like “Add more To work more”
                - VAX architecture had an instruction to multiply polynomials.

RISC Philosophy (Cocke IBM ,Patterson,Hennessy,1980s)
                - Keep the instruction set small and simple,makes it eiser to build fast hardware.
                - Let software do complicated operations b composing simpler ones.

New trend is like “Less instruction But more task”

- MIPS Architecture

MIPS – semiconductor company that built one of the first commercial RISC architecture.
People choose MIPS instead of intel 80x86 because:
                - MIPS is simple,elegant.Don’t want to get bogged down in gritty details.
                - MIPS widely used in embedded apps,x86 little used in embedded, and more                                          embedded computers than PCs.

- SPIM : the MIPS simulator

SPIM (MIPS spelt backwards!) is a MIPS simulator that :
                - reads MIPS assembly language files and translates to machine
                 Language
                - executes the machine language instruction
                - shows contents of registers and memory
                - works as a debugger (supports break-points and single-stepping)
                - provides basic OS-like services, like simple I/O