This document discusses computer programming languages and how programs are converted into machine-readable binary code. It defines an electronic device as a machine that understands binary code. It explains that programming languages like assembly and high-level languages must be converted into machine code for the electronic device to execute. This involves translators like interpreters and compilers that convert instructions and data into binary bits either line-by-line or by compiling the entire program at once.
2. WHAT IS ELECTRONIC DEVICE ?
• Electronic device is a dumb machine.
• Example:- “ A COMPUTER” is an electronic device.
• Electronic device works based on instructions given by Human.
• Electronic device understands only binary code i.e 0s and 1s which is
nothing but voltage ‘ON’ & voltage ‘OFF’.
• Hence, Every Program instruction and data should be converted into binary
bits.
• After conversion we will get binary code/machine code/voltage file.
• For ‘machine/electronic device’, The binary code/machine code/voltage file
is executable code.
3. WHAT IS MACHINE CODE
• Machine code is a stream of raw data which is written in
machine understandable language/ Instruction set architecture
which is understandable by machine.
• Instruction written in Machine understandable language is
known as Machine code. Machine code is in binary form which
is nothing but in 0s and 1s.
• Currently, programmers almost never write programs directly
in machine code, because it requires attention to numerous
details that a high-level language handles automatically.
• Furthermore it requires memorizing or looking up numerical
codes for every instruction, and is extremely difficult to modify.
4. CONVERTING “PROGRAM INSTRUCTION” &
“DATA” INTO BINARY BITS.
• For conversion of program instruction and data into binary bits,
There are Three translators.
1. Interpreters
2. Compiler
3. Assembler for Assembly language program
5. 1. INTERPRETER
• Interpreter runs program line by line.
• Mechanism of Interpreter:-
i. Interpreter goes into memory takes one statement and
execute it, then
ii. Again interpreter go to memory picks up next instruction and
execute it
iii. Again interpreter go to memory picks up next instruction and
execute it
iv. And so on till last instruction in the program.
• Interpreter is slow but need less memory.
6. 2.COMPILER
• Compiler compiles whole program at a time and generate byte
code.
• Mechanism of compiler:-
i. Compiler goes into memory take complete program at once
and compile it.
ii. After compilation compiled version of source code gets
generated.
• Compiler is fast but need more memory space.
8. IF INTERPRETER IS SLOW THEN WHY IT CAME
INTO EXISTENCE?
• In early age there were computer with very small size hard disk
for example with 200mb and Ram with tiny size lets say 200kb
• So In those days interpreter was suitable for this.
9. WHAT IS LANGUAGE ?
• Language is “Instruction set Architecture” to communicate
some meaning/message to the comprehended or receiver.
• In simple words “Language” is a “MEDIUM” of communication.
• For human to human communication we use communication
languages like.. English , French , Arabic, Sign languages etc..
• For Human-Machine communication we use Computer
programming languages for example C, C++, Java, Python, SQL
and so on…