Thread: How is something programmed?

  1. #16
    Registered User
    Join Date
    Oct 2006
    Location
    UK/Norway
    Posts
    485
    I think that we need some clarification from h3ro.
    I love it when people write my name. It always makes me smile to see the goofy name.

    My problem is that I dont see how a computer (or anything else with ICs) is programmed.

    I understand how given one input (eg button pressed) you get an output based on a logic circut. But how do you go from having a mechanical input to having a program as input?

  2. #17
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I understand how given one input (eg button pressed) you get an output based on a logic circut. But how do you go from having a mechanical input to having a program as input?
    What?

    If you can process logic in a circuit then you can also cause voltage to flow or not to flow to another circuit via an IC. There isn't any difference between a standard switch and an IC when it comes to turning something on and off. Usually mechanical motors that will interface with computers are already pre-built and designed to be compatible with PCs or with the board/CPU that will be used to control the machine.

    So normally something like:

    m_pPaintArm->Rotate(.625f);

    Would be sent to the driver that interfaced with the hardware. The driver would then interface with the IC that controlled the arm which would then interface with the motor that actually rotates the arm. As long as all components are using the same protocol and interfaces at the software level and as long as everyone can talk to each other on the hardware level you can control any type of machine from software. If you do some googling you will find that many of the ICs come with a C compiler, assembler, assembly refs, C libraries, etc. All that is left for you to do is buy the EEPROM burner which can be very expensive. Most of the EEPROM burners interface with your computer via USB but some older ones still use the serial port. They are not by any means cheap - google for some Phillips ICs and you will see what I'm talking about.

    I'm not sure what you are confused about.
    Last edited by VirtualAce; 06-18-2008 at 04:44 PM.

  3. #18
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    I think he wants to know how to bridge the step between a few logic gates and the highly complex chips of today, which execute complicated instructions, reschedule them, predict jumps, preload caches, etc.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #19
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Then I woudl like to know what h3ro's level of electronics knowledge is. Do I need to start at explaining how electrons work, or can I just assume you know the difference between a D-type and a J-K type flip flop.

  5. #20
    Registered User Tommo's Avatar
    Join Date
    Jun 2007
    Location
    Scotland
    Posts
    101
    You can take this course and study it yourself.

  6. #21
    Registered User
    Join Date
    Apr 2008
    Posts
    19
    I think I understand what h3ro is asking. Assume you have a small microprocessor, some pins on that processor are used to address memory, and another set of pins are there for the data. You connect these pins to some kind of memory chip. Then when the processor resets it will put some binary number on these address pins, that will cause the memory to put some data on the data pins (there is more going on but I'll try to keep it simple.) That binary number that is on those data pins is some kind of operational code. This code is 'wired' into the processor to do something. Then the address pins might be incremented and the next value read from the memory and that instruction would be executed, and off we go.

    Now how do we get this program into that memory? Basically you wire up some kind of circuit that accesses these same pins on the memory. You put address 0 on the pins (all off) and then put the data on the data pins (with switches or whatever) and then strobe (just another pin with voltage) the memory. That will write that data to the memory at address 0. Then switch to address 1 and repeat. We actually had to program a small microcontroller (uC) like this in college. It was very tedious and it took 20 minutes to enter a program into the uC that would flash an LED.

    The above comment about the punch card reader is just a way to mechanically automate this process. Once you have automated the process a little bit then you write a program to automate it a little bit more, so then you can move from punch cards to programming little microprocessors to read from a magnetic tape, and then from a floppy disk, then from a hard disk and then you simply use each evolution in the tools to make better tools.

    If this isn't what you were asking then I'm sorry for oversimplifying.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tell me the best 1 person programmed game made???
    By RNH in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 12-10-2007, 02:42 PM
  2. Have You Programmed Anything Cool?
    By thetinman in forum A Brief History of Cprogramming.com
    Replies: 53
    Last Post: 05-15-2006, 06:39 PM
  3. Have you ever programmed for MIPS?
    By Maragato in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 10-05-2004, 08:32 PM
  4. Have you ever programmed while drunk or under.....
    By Alphabird32 in forum A Brief History of Cprogramming.com
    Replies: 46
    Last Post: 09-06-2002, 08:30 PM
  5. Game I've Programmed
    By GodLike in forum Windows Programming
    Replies: 0
    Last Post: 04-11-2002, 09:36 AM