220 likes | 420 Views
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE. INTRODUCTION. INTRODUCTION. Computer is an electronic machine, which solves problem → deals with electrical signals Digital → information is presented by variables takes a limited number of discrete values.
E N D
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE INTRODUCTION Introduction
INTRODUCTION • Computeris an electronic machine, which solves problem → deals with electrical signals • Digital → information is presented by variables takes a limited number of discrete values. • Discrete valuesare processed internally by components that contain a limited number of discrete states. Introduction
INTRODUCTION • Ex. Decimal digits: 0, 1, 2,…..9 → 10 discrete values. Binary number: 0, 1. • Computers use binary system because: • It is easy to tell if electrical devices are on (1) or off (0). • Electrical and magnitude storage devices having 2 stable states are simple to construct. • Digital circuits are less affected by noise. Introduction
INTRODUCTION • A binary digit is called abit → information is represented in digital computer in groups of bits. Computer Hardware Software Introduction
INTRODUCTION • Hardware:All electronic components and electromechanical devices that comprise the physical entity of device. • Software:Instructions and data that the computer manipulates to perform various tasks. • Program: A sequence of instructions for the computer. Introduction
BLOCK DIAGRAM OF A COMPUTER CPU: ALU, CCU & registers Output units Input units Memory Introduction
Central Processing Unit (CPU) • Brain of the computer • Consists of ALU ( Arithmetic and Logic Unit ): responsible for performing Arithmetic and Logical Operations. • Consists of CU ( Control Unit ) : tells the ALU what to do. • Consists of Registers : Internal memory of CPU to store temporary data. • Also referred as Microprocessor Introduction
MEMORY UNIT • Memory devices are to store the data for later reference. • Broadly classified into two : • Primary Memory ( Main Memory ) • Secondary Memory Introduction
INPUT UNIT • Accepts data from the outside world • Converts data into the computer understandable form i.e. Binary form • Example of Input devices: Keyboard, Mouse, Microphone, etc. Introduction
OUTPUT UNIT • Produces the output in user readable form. • Example of output devices: Monitor, Printer, Speakers, Plotter Introduction
Programming languages • Machine language ML = binary Difficult to use by programmer • Invented new notations that were closer to the way humans think→ program to translate from symbolic notations to binary = assembler • Symbolic language = assembly language ASM Introduction
Machine language • Hardware started out quite primitive • Design was expensive the instruction set was very simple • E.g., a single instruction can add two integers • Software was also very primitive Architecture Specification (Interface) Hardware
Programming languages • Assembly language → write one line for every instruction that the machine will follow (programmer must think like machine) • High-level language HLL. • program that translates from higher level to ML. Introduction
Programming languages • Machine language: The language a particular processor understands • Assembly language: machine-specific language with a one-to-one correspondence with the machine language for that computer Introduction
Assembly language • Life was made a lot better by assemblers • 1 assembly instruction = 1 machine instruction, but... • different syntax: assembly instructions are character strings, not bit strings Assembler specification UserPrograminAsm Hardware Assembler
Software layers • Machine language • 0010 1011 1101 1000 • 1001 0111 0101 1110 • Assembly language • MOV AX, 3CH • ADD AX, 20H • High-level language • y = 15; • y = y+32; Introduction
High Level Language • Higher level of abstraction: • 1 HLL line is compiled into many (many) assembler lines HLL language specification UserProgramin HLL Hardware Assembler HLL Compiler
Advantages of HLL • It is easier to convert a natural language algorithm to a HLL program. • It is easier to read & understand HLL program than ASM program. • ASM generally contains more statements than equivalent HLL program → more time is required to code the ASM program. Introduction
Advantages of HLL • Each computer has its own ASM → ASM programs are limited to one machine, but HLL program can be executed on any machine that has a compiler for that language. Introduction
Advantages of ASM language • Efficiency: • A well-written assembly language program produces a faster, shorter machine language program. • Some operations, such as reading or writing to specific memory locations & I/O ports, can be done easily in ASM but may be impossible at a higher level. Introduction
Advantages of ASM language • Studying ASM → gain a feeling for the way the computer thinks and the way that things happen inside the computer. Introduction