Programming code tells the computer to do something, but what makes the code actually mean anything to the computer?

1.23K views

Programming code tells the computer to do something, but what makes the code actually mean anything to the computer?

In: Engineering

36 Answers

Anonymous 0 Comments

The basic building blocks are gates, where you can have AND gate and an OR gate. Both take 2 signals and give a result.

A signal is just a voltage, so ‘1’ is more than 2 volts, and ’0’ is less than 2 volts, and 1 signal is called a bit.

Out of these basic building blocks you can make an addition / subtraction/multiplication/division operations for 2 Sets of 64 bits that is.

but when do you use which operation? You build a block that takes 2 extra bits, and you basically can decide that 00 is for addition, 01 for subtraction, and so on, meaning the 4 blocks all have access to whatever is the storage of the 2 64 bits, but you select which operation you want with the 2 bits.

So now you have a list of operations that work on 2 sets of 64 bit numbers that you can reference.

Instead of hardcoding the bits, you can create a compiler that converts certain words into certain operations so instead of ‘00’ for addition, you can give it the word ‘ADD’ and then the 2 sets of bits you want to add.

When you have this basic compiler, you can then extend it to make more complex things like ’if’ and ‘for’ loops, and you can save many commands together as a single command (functions).

So what gives the program meaning? People made the design decisions by making the building blocks, and listing the available blocks, and then designing a compiler that can select and extend those building blocks.

You are viewing 1 out of 36 answers, click here to view all answers.