C Programming………….
C
language is the most powerful and efficient tool used by the programmers all
around the globe. It can be considered as a very versatile language available
now. The evolution of language is quite interesting. Like primitive men, who
started to communicate with symbols people started using the most basic form
called machine language to communicate with the system. But it was quite tiring because the codes
were completely written using 0’s and 1’s. Then came the assembly language
which was developed to simplify human effort. But assembly language was not so
user friendly and then came the era of high level language. It was the
development of these HLL’s that made the tasks so easy for human beings. C
language was developed for programming UNIX operating system(http://en.wikipedia.org/wiki/Unix) by DENNIS
RITCHIE at BELL LABORATORIES in the year 1969-1973. C is a general purpose
language.
C has got a well defined syntax.
Every programmer shall take care of the syntax.
Once if there is any syntax error in the program then the compiler will
detect those errors. Compiler is a program that converts the source code to the
object code or machine level language.
Variables are used to represent memory locations, functions etc. They
are identifiers and defined by the user according to his needs and
requirements. When there is a statement like
X=10;
The compiler associates ‘X’ with the value 10. When a
statement like
Z=X;
Is assigned then Z is directly associated with 10 and hence
if the value of x is varied at any other part in the program the value of Z
will not be varied. The Wikipedia page on C syntax is linked with.(http://en.wikipedia.org/wiki/C_syntax)
In
machine level language there is no concept of data types. But in C language as
every character in the character set is having an equivalent ASCII code there
can be a contradiction between the numerical value ( say 97) and the ACSII code
of characters( say the ASCII code of ‘a’ is 97). To avoid this difficulty data
types were introduced.According to Wikipedia data type is"In computer programming, a data type is a classification identifying one of various types of data, such as floating-point, integer, or Boolean, that determines the possible values for that type; the operations that can be done on values of that type; the meaning of the data; and the way values of that type can be stored"(http://en.wikipedia.org/wiki/Data_types). There are various data types in C like
int,char,float,double . Each of these data types has their own memory
requirement.
Functions
help to modularize the C code. There are various library functions available in
various C header files. These functions are like black boxes and the real
algorithm behind each of these functions are hidden from the user. I have
learned C as a part of my curriculum but then I considered printf() to be a
very easy to use function. And hence felt like disagreeing with Sir when he
told that printf is the most complicated statement in C. But I realized that my
assumptions were wrong when Sir asked to give the output of some printf
statements.
I was really fascinated by a video of TED about the first artificial bird that fly like a real bird using ultraviolet rays. Markus Fischer led the team at Festo that developed this bird
Next up we had a very interesting session by Unni Sir. He helped us to
prepare a mind map. It is very common that we have many random ideas in our
mind when we think of a particular matter. Mind map is software that helps us
to give a structure to our random thoughts. Here we tried to prepare the mind
map for “AFTER B.Tech”. We had many ideas in our mind like MS, M.tech, PhD, a
good job, other courses like MBA, joining defence and so on. Sir could give us
a detailed explanation on the possibilities of each idea that we had.
Next we had a two
hour session on digital electronics. I think it was a too short session because
Parvathy miss had been so engaging and she took the classes so impressively. We
started with the number systems decimal, binary, hexadecimal, octal. Each of
these number systems has their own merits like decimal system is easy to count,
binary system is used in machines, hex is having mare number of bits to
represent data and so on. Then we went on with Boolean and arithmetic
operations. In BOOLEAN ‘+’ is similar to an OR operation
0+0=0
0+1=1
1+0=1
1+1=1
And ‘.’ Is similar to AND operation
0.0=0
0.1=0
1.0=0
1.1=1
Functions could representd as sum of products and products
of sums. To identify a function from the causal relation we can use a K- MAP or
KARNAUGH MAP. In a K-map we group the bits so as to get the function. Each
individual bit is called a literal. Sum of products is like group of AND gates
connected by an OR gate and vice versa for POS.
A bubbled OR is a NAND gate and bubbled AND is a NOR gate.
SOP can be represented as NAND NAND gate and POS by a NOR
NOR gate.
No comments:
Post a Comment