Class 4

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 22

Last Class We cover.

PIR sensor
Power Supply Circuit
Semiconductor Memories
Address bus
Data bus
RAM
ROM
VONN NEUMANN architecture
HARVARD architecture
Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,
Odisha | Tel: 9853200835

Today we cover .
Basics of Programming Language
Compiler
Interpreter
Assembler
Stages of compilation
Data Types
Modifiers
Big-endian & Little-endian
ASCII table
Variables
Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,
Odisha | Tel: 9853200835

Software
Software:It is a collection of programs.

Program:780 Program is a set of instructions which is designed for a


particular
task.
5
Types of software:1. System software
2. Application Software
System software:Which s/w designed for general purpose & which does
not contain any restriction in it is called system s/w.
e.g:- OS, Complier

Application Software:-

Odisha | Tel: 9853200835

Which s/w designed for a specific task only is called


application s/w.
E.g. :-M.S
office,
tally, Oracle
Copyright
2014
Emtronik
technology.| N2/4, IRC VILLAGE, Bhubaneswar,

Compiler
What is translator ???
It is a system s/w which is used to convert the programming
language
code to binary format.
780

5 Types of translator:1. Compiler


2. Interpreter
3. Assembler

Complier:
Aprogramthattranslatesanotherprogramwritteninahighlevellanguageintomachinelanguagein a single step, sothatit
canbeexecuted.

For example high level language just as C, java, C# translate to


machine language which is a form of binary means 1s and 0s.
Because we known our computer can understand 1s and 0s.
Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,
e.g:- Turbo C, Dev C, borland
JVM
Odisha | C++,
Tel: 9853200835
.

Compiler Cont
When a user writes a code in a high level language such
as Java and wants it to execute, a specific compiler which is
designed for Java is used before it will be executed.
780
5
The compiler scans the entire program first and then
translates it into machine code which will be executed by
the computer processor and the corresponding tasks will be
performed.

Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,


Odisha | Tel: 9853200835
.

Interpreter

What is interpreter ???


Aprogramthattranslatesanotherprogramwritteninahigh
levellanguageinto machinelanguage/ binary format in step by
step.
780

5 Each time when an interpreter gets a high level language code


to be executed, it converts the code into an intermediate code
before converting it into the machine code.
Each part of the code is interpreted and then execute separately
in a sequence and an error is found in a part of the code it will
stop the interpretation of the code without translating the next set
of the codes.

Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,


Odisha | Tel: 9853200835
.


Differences between compiler and interpreter
are listed bellow

The interpreter takes one statement then translates


it and executes it and then takes another statement.
780
While the compiler translates the entire program in
5
one go and then executes it.
Compiler generates the error report after the
translation of the entire page while an interpreter will
stop the translation after it gets the first error.
Besides the processing and analyzing time the
overall execution time of a code is faster for compiler
relative to the interpreter.

Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,


Odisha | Tel: 9853200835
.

Assembler
It is system software which is used to convert assemble
language instruction into binary format.
780
5
What is self/resident complier ?

If a complier which runs on a computer and produces


the machine codes for the same computer then it is
called self compiler or resident complier.
If a complier that runs on a computer and produces
the machine codes for other computer then it is called
Cross Complier.

Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,


Odisha | Tel: 9853200835
.

Stages of compilation

780
5

Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,


Odisha | Tel: 9853200835
.

Data Types
Basic types of data types are: char
int
float
double
char - data type
chardefines characters.
e.g :{
char Letter;
Letter = 'x';
}
Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,
Odisha | Tel: 9853200835

Data Types cont


int - data type
intis used to define integer numbers.
e.g.:{
int Count;
Count = 5;
}
float - data type
floatis used to define floating point numbers.
{
float Miles;
Miles = 5.6;
}
Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,
Odisha | Tel: 9853200835

Data Types cont


double - data type
doubleis used to define BIG floating point numbers.
It reserves twice the storage for the number. On PCs
this is likely to be 8 bytes.
e.g:{
double Atoms;
Atoms = 2.5000006;
}

Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,


Odisha | Tel: 9853200835

Modifiers
The data types explained previously have the following
modifiers.
short
long
signed
Unsigned
The modifiers define the amount of storage allocated to the
variable. The amount of storage allocated is not cast in
stone.
ANSI has the following rules:
short int <= int <= long int
float <= double <= long double
Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,
Odisha | Tel: 9853200835

Data Types Range

Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,


Odisha | Tel: 9853200835

endian

Big-endian and Little-

Big-endian system address are always in ABCD and


data is stored in ABCD order.

Little-endian system address are always in ABCD and


data is stored in DCBA order.

Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,


Odisha | Tel: 9853200835

Variable :
Variable :
A variable is a named object that resides in the RAM
and is capable of being examined and modified.
Properties of a variable:
Scope of the variable (local and global)
Life of the variable (initialization and free)
Default initial value of a variable
Storage of a variable (Memory / register)
Lvalue and Rvalue of the variable
Qualifier of the variable (const and volatile)
Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,
Odisha | Tel: 9853200835

Types of variable
(a)Variables which can store only one data at time.
Example: integer variables, char variables, pointer
variables etc.

(b)Variables which can store more than one data of


similar type at a time. Example: array variables

(c) Variables, which can store more than one value of


dissimilar type at a time. Example: structure or
union variables.

Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,


Odisha | Tel: 9853200835

variables

Rules for naming

Variable name must be within 32 char in


16bit compiler such as turbo C and 4096
characters in 32 bit compiler like GCC.
Int abcdefghijklmnopqrstuvwxyz123456=200;

The First char must be an alphabet or an


underscore and the rest can be
alphabets ,digits and underscore.
No space or special character allowed.
No keyword can be a variable name.

Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,


Odisha | Tel: 9853200835

Lvalue
LValue: Lvalue standsforleft value. In any assignment statement LValue
must be a container i.e. which have ability to hold the data. In c has only
one type only container and which is variable. Hence LValue must be any
variable in c it cannot be a constant, function or any other data type of c.
//10=5;
LValue cannot be a integer constant
//max=20; //Lvalue cannot be a micro constant
//b=11; Lvalue cannot be a constant variable
//float=3.3f; Lvalue cannot be a data type
//abc={sachin,5}; Lvalue cannot be a data type
//BLUE =2; Lvalue cannot be a enum constant
Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,
Odisha | Tel: 9853200835

Rvalue
RValue: In any assignment statement RValue must
be anything which can return and constant value or it
is itself a constant. RValue can be any c constants,
variables, function which is returning a value etc.
//RValue
//RValue
//RValue
//RValue
//RValue

can
can
can
can
can

be
be
be
be
be

a
a
a
a
a

constant.
constant variable
variable.
enum constant.
function.

Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,


Odisha | Tel: 9853200835

THANK YOU !!!

Emtronik Technology
Website : www.emtronik.in
Cell : 9853200835/111023
Address : N2/4,near CRP
Copyright 2014 Emtronik technology.| N2/4, IRC VILLAGE, Bhubaneswar,
Odisha | square
Tel: 9853200835

You might also like