0% found this document useful (0 votes)
6 views2 pages

How Computers Understand Code

Uploaded by

Thanushree V
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

How Computers Understand Code

Uploaded by

Thanushree V
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

[Link]

utm_content=DAGULGtsVtI&utm_campaign=designshare&utm_medium=link2&utm_source=shareb
utton

SLIDE 1: Programmesrs or just People in order to write the CODE & certainly know
how to write a Program to calculate the Factorial of a number

SLIDE 2: Check if a String is Palindrome or not

Implement Dijkstras shortest path and many more...........,

SLIDE 3: but DO YOU KNOW HOW IT WORKS?

SLIDE 4: HOW YOUR COMPUTER UNDERSTANDS CODE?

SLIDE 5: COMPUTERS UNDERSTANDS ONLY BINARY DATA,what does it mean, it means that
computers can only deal with zeros and ones,no other things but have you ever
wonder WHY?

let me verify to you?

SLIDE 6: Computers are made of Circuits these circuits are nothing but a sequence
ofgates, like AND gatr,NOR gate,Ex OR gate

SLIDE 7: And all these gates are actually made of transistors, transistor is a
fundamental building block of a computer.
“Trasistors what makes the computer works”

SLIDE 8: What Exactly is the Transistor ?


It is a component that can basically hold two states

First state is “ON” , which can be represented as “1”

Second state if “OFF” , which can be represented as “0”

Now, it make sense why computers can only Deal with Zeros and Ones

SLIDE 9: Now let's come into the big picture, how we say that a program like this
we understood and executed by a computer which only understands Zeros and Ones.

Any Program written in any Programming language must eventually be converted into
machine instructions. So that our computer understands it.

SLIDE 10: This Conversion from Source Code from Machine Instructions is made
possible by a set of magical tools together know as the compliation system

To know more about how this conversion works let's actually take a step-by-step
approach on how a program is written complied and finally executed.

Let's construct this simple C program which basically adds 2 numbers and prints the
sum of these numbers.

Now I write a New Code and save it as hello1.c, now I will run the code it gives a
result as 5.

Intially when I save the hello.c file on this device it is actually saved as a
sequence of bytes the program that i written basically contains English
alphabets,special characters and numbers. Now in order to convert these
individually tokens or character into binary we first convert each character into
decimal format and go on to convert these decimal values into their binary format
so most computers follow the ASCII standard to do the same, basically each
character has its own corresponding numeric value.

SLIDE 11: For example, the character # has the ASCII value 35 & the character of
this i has the ASCII value 105, similarly all the character have their own numeric
value once the characters are converted into their ASCII values they are then
converted into Binary format, each character is represented using 8 bits or in
other words one byte now that everything binary these sequence of bytes can finally
be saved on the computer's file system, the next step is

Common questions

Powered by AI

A compilation system converts the C program's high-level code into machine instructions that a computer can execute. This involves converting the written characters into binary format through ASCII representation, allowing the computer to save and eventually execute the program, resulting in the calculated sum being displayed .

Transistors act as fundamental components in computer circuits, serving as switches that control the flow of electricity. These components are essential as they enable the circuit to hold states of ON and OFF, corresponding to binary values 1 and 0. This binary data processing is central to how a computer interprets and executes instructions .

Circuits in computers, composed of various logic gates like AND, NOR, and XOR gates, conduct binary operations by processing data as sequences of zeros and ones. These gates manipulate binary inputs to produce desired outputs, contributing to data processing and decision-making in computers .

The fundamental building block of a computer is the transistor, which can hold two states: 'ON' represented as '1', and 'OFF' represented as '0'. This binary state system is the reason computers process data using binary (zeros and ones).

A computer translates human-written code into binary by first converting the code's characters into their ASCII numeric values, as most computers follow the ASCII standard for this conversion. Each character's ASCII value is then represented in binary format using 8 bits, or one byte .

Computers rely on binary data because the fundamental components, transistors, handle two states - ON and OFF, represented by 1 and 0, respectively. These binary states align with the transistor's functionality in controlling electrical flow, which is integral to computation processes .

The conversion from source code to machine instructions is achieved through a compilation system. This process involves translating the high-level language into machine code that a computer can understand, as computers operate using binary instructions . This conversion is crucial as it bridges the gap between human-readable code and machine-executable instructions, enabling the execution of programs on a computer.

Each character in computing systems is represented by 8 bits or one byte to standardize data encoding processes, offering a balance between complexity and sufficient range to cover all characters in the ASCII standard, thus ensuring consistent interpretation and storage by the computer .

The transformation of a code character like '#' into binary involves initially converting it into its ASCII value, which is 35. This decimal value is then translated into an 8-bit binary representation, facilitating the computer's ability to handle it as binary data .

A program saved as a sequence of bytes is interpreted by the computer system through a series of conversion steps. Initially saved in a high-level code, it's translated into ASCII numeric values, then into binary format. This byte sequence, stored in the file system, represents machine instructions the computer can execute .

You might also like