Okay. Haven't posted in a while but I know there are some great minds bouncing around in this coordinate of HP. Ive been doing a lot of personal research on programming and operating systems and the like. Now I fancy myself as quite the geek but programming has never been the forte.
What Id like to know, if anyone can help me out here is... How does the signal processing of binary compilation actually induce a specific activity ? For example. Code is written in programming language or some system of abbreviations and terms. Then it is compiled into a series of ones and zeros that represent the negative and positive string of relays for the computer to blast through its circuitry. So if the code were telling the computer to input text and output sed text to the screen, how does the computer know what piece of hardware to blip to make that happen ? Basically how does a series of on and off switching know to activate the pixels on the monitor ?
Im not looking for a tutorial on system architecture here....mind you Im trying to understand on the conceptual level how does the computer recognize that compiled code as a specific action ? How does the word "PRINT" in BASIC but represented to the computer as blah blah ones and zeros...how does it understand that as (do all this fancy crap to activate the monitor based on the input) ?
I know this is an odd question but I dont think I can ask it any better than I have.
RE: Any Computer scientists in here ?
And I won't complicate things by mentioning that machine code is not the lowest level of code running on a computer. Oh! go on then I will. Essentially there is a macro-code being executed within the processor which takes each of the machine code instructions and carries out the tasks required for each instruction. Each task can take different amounts of clock cycles to execute depending on what they are doing e.g. a division instruction will take far longer than an addition instruction as a bitwise addition is far simpler to do.
The nitty gritty of the computer works on the system clock, which is why the faster the clock speed (Hz or GigaHertz on todays computers) the faster the instructions are executed.
An example of multiplying two binary numbers is done by shifting the bits to the left e.g. (simple example)
If we take the binary for the number 2:- (let's call this A)
00000010
And want to multiply this by 4:- (let's call this B)
00000100
we shift all the bits in B right by one place:-
00000010 (A)
00000010 (B)
and if B is greater than 0 we shift A left by one place:-
00000100 (A)
00000010 (B)
again shift B left one place:-
00000100 (A)
00000001 (B)
if B > 0 shift A left by one place:-
00001000 (A)
00000001 (B)
shift B right again:-
00001000 (A)
00000000 (B)
B is no longer greater than 0 so we finish
00001000 (A) = 8 in binary, which is the result of 2 x 4
That's the basics of binary multiplication, it's not much more tricky to do it with odd numbers. Division on the other hand is a different kettle of fish although it does still involve shifting the bits sideways.
As described above, getting the things drawn on the screen is just a case of accessing the address bus of the computer to obtain the data from one area of memory that represents the pixels and writing it into the memory address which the graphics card uses and then signalling to the graphics card that there is data there to be updated. There are a couple of ways the data can be presented to the graphics card... one way is to actually write the pixel data directly into the graphics cards memory, or the other way is to give the graphics card instructions representing what is required to be drawn. Obviously the latter produces faster graphics as the instruction to draw a line from X,Y to X1,Y1 will be smaller than detailing each of the individual pixels involved, and also the graphics card processor can worry about doing all the hard work, leaving the computers processor to get on with all the other tasks it has to do.
Could go into so much more detail, but I'd be here all day.... 😀
Love and Reiki Hugs
RE: Any Computer scientists in here ?
Wow you guys. That's deep, Im seriously impressed how right on you both are. I didnt know it before but I can tell by reading it how much sense it makes.
So if I understand this correctly... the binary instruction is just boiled down to a mathematical trade off of memory inside the hardware components driven by the signals and shared processing if any ?
Which would explain why each component has its own particular attributes, especially with graphics cards making each person's computer see the same image in a different way.
Man, I knew the computer didnt understand anything but math but for some reason that never dawned on me that it used it that way.
RE: Any Computer scientists in here ?
yep that's it, it's all about moving -ve and +ve charges (0's and 1's) from one place in memory to another. 😀
RE: Any Computer scientists in here ?
A mathematician, Von Neumann conceived the basic design upon which all modern computers are based. The design is called Von Neumann architecture.
VNa comprises an Input/Output unit, an Arithmetic/Logic unit, a Control unit, and a Memory unit. These basic units, are coupled by a multiway data Bus, and have 'addesses' assigned by an Address unit, so that each unit can interact with the correct other (part of) another unit.
In the PC and similar 'simple' computers, the A/L unit and the C unit are combined into the CPU.
The I/O unit allows the computer to interact with input devices, keyboard, mouse, sensor device and output devices , printers, displays, machine tools. Storage devices such as hard drives, CD ROMs are also controlled as input/output devices. Input/output of preset programs are also controlled here.
The A/L unit part of the CPU, performs all arithmetic operations , including logic equals., and has a register, acting like fast RAM for holding the results of the calculations, and ALU circuitry, formed from AND, OR, and NOT gates to perform the basic logic calculations. The C Unit part controls the supply of the program instructions to the A/L unit, 'looking' at the program code to decide what the next calculation is required from the A/L unit, and if anything needs to be sent from or to the I/O unit. This carries on until the Quit or Stop command is sensed.
The Memory unit serves as temporary storage for both the data being fed into the CPU and resulting from the CPU actions.
Leo