Thread: How the computer understand the 01010101110

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    43

    How the computer understand the 01010101110

    If , as we know, all the information in the computer are just 0's and 1's , how does the computer know if the array of 0's and 1's is a picture or a sound or text, if at the basic they are just 0&1 !?

  2. #2
    ! |-| /-\ +3 1337 Yawgmoth's Avatar
    Join Date
    Dec 2002
    Posts
    187
    The computer actually doesn't really know. One way humans help the computer differenciate between pictures/text/etc. is the filename extensions ( .bmp, .txt, .wav, .etc). You could rename a .bmp to a .txt and then the comp would read it as text ( but screwed up text, whcih doesn't make sense)
    L33t sp3@k sux0rz (uZ it t@k3s 10 m1|\|ut3s 2 tr@nzl@te 1 \/\/0rd & th3n j00 h@\/3 2 g3t p@$t d@ m1zpelli|\|gz, @tr0(i0u$ gr@mm@r @|\|d 1n(0/\/\pr3#3|\|$1bl3 $l@|\|g. 1t p\/\/33nz j00!!

    Speling is my faverit sujekt

    I am a signature virus. Add me to your signature so that I may multiply.

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    The computer doesn't know such a thing. On the low level, everything that happens in a computer is logical and mathematical operations (mathematical operations are buildt upon logical operations) from a digital point of view. It's up to us how we translate what the comp is doing.
    By sending data (1's and 0's) to a port, it can be considered a visual image to a monitor or text to a printer. It's up to us.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  4. #4
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    >how does the computer know if the array of 0's and 1's is a
    >picture or a sound or text, if at the basic they are just 0&1 !?

    The computer doesn't know anything. If you have a collection of 0's and 1's which represent for example a gif-picture, you have to use or write a program able to understand it.

    Perform a search on Google or some other search engine to find out about file formats, there it is explained how programs should interpret the collection of 1's and 0's.

    A collection of 0's and 1's is useless unless there is software to interpret it, if it is interpretable.

  5. #5
    yeah, the comp itself knows nothing -- but the file formats contain I think headers that tell the comp OS which type of file it is and then which associated program should be used to open it...

    If u rename the extensions of something like a movie file from .avi to .mpg sometimes the program that opens the file can tell that the file is really an AVI even though the extension has been changed - this would be due to a header within the file.

    The comp doesn't do anything - I think the diferation takes place within the OS and the file formats.
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

  6. #6
    Registered User
    Join Date
    Dec 2001
    Posts
    43
    Thank u very much

    I got the perfect answer, thank you very very much

  7. #7
    I hate Sinus infections
    Join Date
    Nov 2002
    Posts
    181
    Does this mean that the computer just knows 0's as off currents and 1's as on? Because i thought the OS ran on the processor. If so, then how does it know how to run the programs that interpret the 1&0's, or is this something like AP CS that an idiot like me shouldn't be asking about and needs to get his head back in the grips of insanity about the world?
    The only good thing about freezing beyond feeling in the final Nordic ski race was that I couldn't feel that tumble I did going about 30 mph, maybe more.
    On the other hand, not feeling any part of my body for 30 minutes was scary, especialy for my manhood.

    Windoze: XP, hate it, though its more stable than my old 98SE
    Dream: linux, mandrake, then slackware.

  8. #8
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    To be a smartass, it's actually low levels of electricity and high levels. There's no "off".

    >Because i thought the OS ran on the processor.<

    Don't think of it as the OS running on the processor. Think of it as the processor executing the instructions that make up the OS.

    >If so, then how does it know how to run the programs that interpret the 1&0's<

    Huh? The CPU is what understands binary...

  9. #9
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    1:s and 0:s aren't current on / current off. If the voltage range from 0 - 5 V, 0 could be 0 - 2 V and 1 could be 3 - 5 V. There is also an 'uncertainity' area between 2 - 3 V where the processor is unable to decide which it is.

    Explaining how a processor works is kinda complicated, though it is based on very logical instructions.
    Basically, at the very bottom you have somethinhg called micro-code, which is a list of 1:s and 0:s who controls various operations in the processor, for example tristate buffers which lets currents pass or not. A 1 means open and a 0 means closed (well, that depends on the structure, but lets assume that it is correct here).
    This list lies in some kind of memory, probably a ROM (read only memory) since you're usually not allowed to modify these instructions.
    Basically, one line is executed then the next and so on (pretty much the same as any programming language). There is also support for conditional/unconditional jumps.

    Now, coding entire programs controlling every single tristatebuffer, R/W functionality for RAM:s and such takes time and is a hard tedious work. That's why they invented assembler. Assembler instructions are buildt upon one or several microcode instructions and makes programming a lot easier.

    It's also a great abstraction since several processors with different structures and microcodes can still use the same assembler instructions, thus making programs more compatible.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  10. #10
    >>To be a smartass, it's actually low levels of electricity and high levels. There's no "off".

    I think usually in comps it's 0.5V for OFF and 5V for ON...
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

  11. #11
    I hate Sinus infections
    Join Date
    Nov 2002
    Posts
    181
    Oh, i get it.

    The OS just is a sort of reference book.

    It directs the processor where it needs to go and what instructions to use to interprit the raw data.
    The only good thing about freezing beyond feeling in the final Nordic ski race was that I couldn't feel that tumble I did going about 30 mph, maybe more.
    On the other hand, not feeling any part of my body for 30 minutes was scary, especialy for my manhood.

    Windoze: XP, hate it, though its more stable than my old 98SE
    Dream: linux, mandrake, then slackware.

  12. #12
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    >The OS just is a sort of reference book.<

    Yes, you could look at it like that. However, taking out the "just" would be more accurate, as an OS is much more than that depending on how you look at it...

  13. #13
    >>The OS just is a sort of reference book.

    The OS is really an added layer - it's an application - that allows you to move, copy, delete, and other crucial stuff - most of which deals with allowing you to interact with hardware. At the chip level, the chip understands very basic commands that are standard 10101's code like I think 120 in binary represents the start of an executable application - there are other codes that represent the start and end of a file and some others. The chip itself understands how to add,subtract - etc... u can find out what the chip itself can do by learning ASSEMBLY language that is provided by the chip manufacturer.

    The OS is an added layer that goes well beyond assembly language and the basics of what the chip can do - it also greatly simplifies the interaction and usage of hardware and even software contained within the comp. All good OS's have an API like win32API that allows you to take advantage of all the inherit functions that the OS provides.

    The OS is critical b/c it manages the smooth operations of the hardware and software - it also makes sure that software programs don't step on each other's memory allocations and just get in each others way, and not overwhelm the processor either.

    You can think of the OS more as a FILTER for the processor - keeping things orderly and efficient - managing resources.
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 34
    Last Post: 02-26-2006, 01:16 PM
  2. Major Computer Problem
    By Olidivera in forum Tech Board
    Replies: 10
    Last Post: 07-15-2005, 11:15 AM
  3. Tabbed Windows with MDI?
    By willc0de4food in forum Windows Programming
    Replies: 25
    Last Post: 05-19-2005, 10:58 PM
  4. Computer will not boot.
    By RealityFusion in forum Tech Board
    Replies: 25
    Last Post: 09-10-2004, 04:05 PM