Home | Community | Message Board

Magic Mushrooms Zamnesia
This site includes paid links. Please support our sponsors.


Welcome to the Shroomery Message Board! You are experiencing a small sample of what the site has to offer. Please login or register to post messages and view our exclusive members-only content. You'll gain access to additional forums, file attachments, board customizations, encrypted private messages, and much more!

Jump to first unread post Pages: 1
How do computers work?
    #4648233 -

I was walking and talking about memories and stuff with my friend, and then he asked how computers work at their basic core. i thought it wasnt a big deal, but now i just got stoned out of my mind, and im thinking about it, and its really messing with my head.
How does something go from analogue to digital? Like i realize it's switches that produce different energy impulses, but how do you write the first program to _interpret_ those energy signals, when those signals are just more enrgy??


--------------------
"The worst mistake that you can make is to think you're alive when really you're asleep in life's waiting room."

Edited by Limelight (09/11/05 10:16 PM)

Extras: Filter Print Post Top
Re: How do computers work? [Re: Limelight]
    #4648237 -

edited for stoned stupidness

edit again..


--------------------
"The worst mistake that you can make is to think you're alive when really you're asleep in life's waiting room."

Edited by Limelight (09/11/05 10:19 PM)

Extras: Filter Print Post Top
Re: How do computers work? [Re: Limelight]
    #4648369 -

PM Seuss if you're REALLY interested in how computers work from the ground up. That guy knows his shit, the problem is you probably won't understand half of it-- unless you're an Electronics Engineering major or something :grin:


--------------------

Extras: Filter Print Post Top
Re: How do computers work? [Re: Limelight]
    #4648377 -

Quote:
Seuss said:
It has been a while since my digital design classes, but I have built a computer from the transistor level up and I am fairly certain there is no alien technology involved.

A computer is a collection of switches that are either on or off. On is one, five volts (for example), and off is zero, or zero volts.

These switches can be combined to form logic gates. The three important ones are AND, OR, and NOT. Actually, AND and NOT are usually done with a single NAND gate... if you want a NOT, you just tie the two inputs together.

The simple logic gates above can be combined to form more complex logic such as XOR.

They can also be combined to create more complex components such as ADDERS and MULTIPLEXERS and LATCHES and FLIP-FLOPS, etc.

A latch for example, holds onto a value. If you combine 32 latches and tie their control lines together, you get a 32-bit REGISTER.... which can hold a 32-bit number. The number is stored base-2, or binary. It is trivial math to convert from base-2 to base-10 which is what we are used to working with. (101b=5d 1*2^2+0*2^1+1)

A CPU in a computer combines lots and lots of the above to function in the von-neumon model. The model says you have a CPU which does something and memory which stores something. The CPU takes something from memory, operates on it, and puts it back into memory.

The main stages in a CPU are as follows... from memory so may be off a bit:

1) fetch/decode instruction
2) fetch from memory / prepare registers
3) alu (arithmetic logic unit, does the operation from 1 on the values from 2)
4) memory write back (put the value from 3 back to memory or register)
5) loop back to 1

Things get kind of nasty when you start adding in interrupts, pipelines, prefetch queues, cache memory, etc...

It is a pain to work with transistors at this level. Instead, we use a language such as VHDL to express what we want to occur. The VHDL compiler will generate the transistor level layout based on the technology (mosis standard cell, etc) that you wish to use. The programs that do this are usually very expensive. I worked with mentor graphics which ran around $800,000 at the time.

I simplified things... it would take two or three grad level EE classes to explain how things worked, but it is all very forward and logical... there is no voodoo or magic involved.




check out this thread I made ages ago:
http://www.shroomery.org/forums/showflat...rue#Post1563584


--------------------

Extras: Filter Print Post Top
Re: How do computers work? [Re: mantis]
    #4648420 -

Hmm... well that went completly over my head and I've built one computer, and taken a programming class. Good luck guys lol.


--------------------
Psilocybin, It's what's for dinner, tonight...

Extras: Filter Print Post Top
Re: How do computers work? [Re: Limelight]
    #4648522 -

also remember that the computers we use today weren't simply invented overnight. It took a lot of very smart people a very long time to get to this level of complexity.

besides, even after taking some form of computer-systems degree most people still don't completely understand every aspect of how a computer functions. it's all about abstraction, and working in teams of diverse skills to create systems this complex.

Extras: Filter Print Post Top
Re: How do computers work? [Re: soma_victim]
    #4648661 -

Ok, think of it this way. The first computers ever built - the ones that weighed several tons and had the power of a modern calculator used punch cards as input. Punch cards are cards will holes in them, inputting either 1 or 0, a boolean of false or true. These binary codes equalled out to a number when decoded. These numbers would then equal out to letters or a pixel on the screen, a vector in a game, a vector would equal out to a 3D image, and that would equal out to some character in a 3D game. It's all a collection of decoders, one inputting information, one outputting.


--------------------
010001100100001001000101!

Extras: Filter Print Post Top
Re: How do computers work? [Re: Fospher]
    #4648700 -

hmm. i smoked more thought about this again, and i sort of get it i think.. so it would go something like this, except cosmos more complex?

if pixel one is lit up, light up pixel 44, if both pixel 44 isnt on light up 32..

:rofl:


--------------------
"The worst mistake that you can make is to think you're alive when really you're asleep in life's waiting room."

Extras: Filter Print Post Top
Re: How do computers work? [Re: Limelight]
    #4648712 -

Limelight said:
hmm. i smoked more thought about this again, and i sort of get it i think.. so it would go something like this, except cosmos more complex?

if pixel one is lit up, light up pixel 44, if both pixel 44 isnt on light up 32..

:rofl:



Im not really sure what you mean.  A display adapter is just a certain function of a computer.

Extras: Filter Print Post Top
Re: How do computers work? [Re: TheCow]
    #4648726 -

im wondering how the hell you can get math equations and stuff out of just using and, or and not... i mean going from pulses of electricty to mathematical (more or less) equations which can interpret itself i just dont get.


--------------------
"The worst mistake that you can make is to think you're alive when really you're asleep in life's waiting room."

Extras: Filter Print Post Top
Re: How do computers work? [Re: Limelight]
    #4648743 -

like i understand that something has to decode the other end.. but i dont get how you can build something out of nothing. like i coudl see how you could build equations out of using a lot of logic gates.. but how do you write a program to understand those logic gates and turn them into other things, when the programs themselves are just logic gates.. i guess sort of like trying to learn spanish what its taught to you from the beginning in spanish.


--------------------
"The worst mistake that you can make is to think you're alive when really you're asleep in life's waiting room."

Extras: Filter Print Post Top
Re: How do computers work? [Re: Limelight]
    #4648745 -

fuck im so confused :frown:


--------------------
"The worst mistake that you can make is to think you're alive when really you're asleep in life's waiting room."

Extras: Filter Print Post Top
Re: How do computers work? [Re: Limelight]
    #4648850 -

Because 0 and 1 is the basis of all technology, math, and science. I guess an easier way to understand computers is to understand that they are just pieces of hardware designed to manipulate the on and off's of electricity. Its all a manipulation of energy. Everything you do on your computer is designed to get the electricity out of the wall, manipulated to the users will, and displayed on the screen.

If you dont understand how to build formulas out of logical commands, take a C programming class. They teach you how to write an formula to solve any situation using AND/OR, IF/THEN, etc...

its incredibly hard turning every situation into a damn formula, thats why i never took a programming class after C. shit like that takes away from the value of life.

Extras: Filter Print Post Top
Re: How do computers work? [Re: Puppet1]
    #4648942 -

It's not 'pulses of electricity'. It's just input and output of information between peripherals.


--------------------
010001100100001001000101!

Extras: Filter Print Post Top
Re: How do computers work? [Re: Puppet1]
    #4649305 -

Puppet1 said:
its incredibly hard turning every situation into a damn formula, thats why i never took a programming class after C. shit like that takes away from the value of life.



I guess that was essentially what i was asking. I cant imagine the geniuses who can do that  :smirk:


--------------------
"The worst mistake that you can make is to think you're alive when really you're asleep in life's waiting room."

Extras: Filter Print Post Top
Re: How do computers work? [Re: Limelight]
    #4649352 -

http://en.wikipedia.org/wiki/Binary_numeral_system

It all begins with the binary system, so that's the best place to start out!

To "digitize" something, we take "samples" of whatever level we want to measure repeatedly a certain number of times per second. CD music, for example, uses a 44.1 kHz sample rate. 44,100 times a second we take a "snapshot" of the instantaneous soudwave amplitude, then store that as a number (usually decibels?). Say the value is 56 decibles, then this is stored in computer memory as 111000.

Manipulating the data is relatively easy, once it is in a binary state. On your CPU there are "registers" which are groups of transistors that each represent a "place value" in a "binary word". The size of these registers is what is meant when they say "32-bit chip" or "256-bit chip". Most PC chips these days are 32-bit, so the registers each have 32-bits in them (a "double word"). Say you want to add 4dB (100) to our previous value:

You stick the first value 111000 in register A, and the second value 100 in register B. Then you simply add together the first bit from each register, then the second, then third, and on, putting the result of each addition in a third register, C. The result you get, in this case, is 111100.

It doesn't take a genius to program a computer. Understanding binary will go a long way in helping someone program a computer, but it is by no means necessary. All "high level" languages take away all of the low-level hardware programming. You never see binary. High-level languages consist of human-readible code that represents entire sets of machine-code.

In C, for example, if I just want to print something to the screen I type:

printf("hello!");

(printf means "print formatted text")

So programming in these languages isn't as technical as one might think. Learning the basic syntax and grammar is probably the hardest part. You never really have to memorize any of the functions (like printf) - most people just keep a pile of textbooks around with pages and pages of functions as reference.

Of course someone (a team of someones) does have to program the compiler itself. The compiler is the program that takes all your high-level code like printf and converts it into machine-readible code for the processor to use. This is by no means an easy task, and to my knowledge takes a team of mathematicians to do. Not because programming in machine language is so difficult, but converting human language into machine language is exceedingly difficult.

I dunno, I'm pretty stoned. That was a fun rant.


--------------------
Once, men turned their thinking over to machines in the hope that this would set them free.
But that only permitted other men with machines to enslave them.

Extras: Filter Print Post Top
Jump to top Pages: 1


Similar ThreadsPosterViewsRepliesLast post
* Useful tool for computer noobs Phive_Sicks 419 0 10/21/06 05:15 PM
by Phive_Sicks
* question about the F.B.I and computers
( 1 2 all )
Fucknuckle 2,926 31 08/12/04 11:24 PM
by Fucknuckle
* Trying to find a degree program.. help? Drink_Punk_Soda 1,102 7 10/06/05 07:36 PM
by Vvellum
* Computer Stuff: Making your computer faster
( 1 2 all )
EvLiL 4,089 28 08/15/07 10:49 PM
by Konnrade
* How to speed up my computer?? Toddo 1,683 17 05/12/05 04:49 AM
by ummikko
* Programming in Machine Language using The Tertiary Numeral System [ 1 0 1 ] findoutnow 733 1 02/13/07 08:36 PM
by daytripper05
* Your first computer
( 1 2 3 all )
HagbardCeline 3,512 41 01/11/04 04:00 PM
by justsmurfy
* Sometimes I fight with my computer. Little Shroom 2,389 17 07/24/03 03:45 PM
by oDin

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: Entire Staff
1,151 topic views. 1 members, 1,349 guests and 226 web crawlers are browsing this forum.
[ Show Images Only | Sort by Score | Print Topic ]
Search this thread:

Copyright 1997-2026 Mind Media. Some rights reserved.

Generated in 0.029 seconds spending 0.009 seconds on 16 queries.