0
What's the breakdown of ruby to binary code or how does a coder code it to view its brakedown
programs conversions to binary data core
1 Answer
0
you might have heard that computers run on binary. now what is binary, it means 2.now 2 types of signal is enough to convey a message like u can convey that temperature in ur room is more than 30 degree by switching ur light on and vice versa. (ok this might not be enough to do calculations in computer but at least u can do it.)
there are two types of signals used in computers either 0v or 5v.represented by 0&1 respectively.
now in computers there are transistor which are made up of silicone a semi conductor they either store or free those currents according to the current. now suppose you want to represent decimal number 5 in binary then it is converted in binary system and represented by electrical currents by either 0v or 5v accordingly.now all calculations are done using it like you have to add any number to it. for this electric current in 0v or 5v is added and it goes through adder unit which are made up of transistors (hardware).
now how this happen in a normal computer when u click on some button it is converted to binary and represented by binary(actually 0v or 5v).
now ruby is a compiled language which means that it is compiled into machine code(somewhat similar to binary but also represent memory, etc.)first u right a program in pure text form it is converted in binary(actually not but it is another topic)and then a compiler which is a program written to convert those code in machine code which means converting it into electric current at its core. now compiler is also compiled in the past and is converted into machine codes and now it is doing its work that is converting normal word into machine codes.
hope it helps
cheers!