dcsimg
Results 1 to 28 of 28
  1. #1

    Thread Starter
    Android OpenGL ES Guru Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,220

    [Serious] How do old chips work?

    After a series of life events between when I simulated the 6502 processor and now, I decided to redo an entire C++ project from scratch, and make it more based on the RP2A03G chipset rather than the MOS6502. But either way, I don't understand how the real chips work. I know the VCC pin being 5V+ in and VSS or GND being ground, and I understand phi2 and clk, but what I do not understand is how instructions are executed through it when you only have a D0-D7 (8 pins) of data bus input and output, as well as A0-A15 (16 pins) of address bus being only output. At least I think it's only output based on this diagram:

    Code:
    //        .--\/--.
    // AD1 <- |01  40| -- +5V
    // AD2 <- |02  39| -> OUT0
    ///RST -> |03  38| -> OUT1
    // A00 <- |04  37| -> OUT2
    // A01 <- |05  36| -> /OE1
    // A02 <- |06  35| -> /OE2
    // A03 <- |07  34| -> R/W
    // A04 <- |08  33| <- /NMI
    // A05 <- |09  32| <- /IRQ
    // A06 <- |10  31| -> M2
    // A07 <- |11  30| <- TST (usually GND)
    // A08 <- |12  29| <- CLK
    // A09 <- |13  28| <> D0
    // A10 <- |14  27| <> D1
    // A11 <- |15  26| <> D2
    // A12 <- |16  25| <> D3
    // A13 <- |17  24| <> D4
    // A14 <- |18  23| <> D5
    // A15 <- |19  22| <> D6
    // GND -- |20  21| <> D7
    //        `------'


    How are instructions fed into it, and what addresses are outputed? Is it the address you are working on? Is it the new address? If anyone has better sense of electronics than I do, let me know. Thanks. And also....Happy New Year!!!

  2. #2
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    4,476

    Re: [Serious] How do old chips work?

    Well, since the chip is the processor, all the registers, and logic is inside it.
    The Address lines are output only because they are used to address the memory, which is outside the chip.
    The processor should have a Program Counter register, or something along those lines, which is used to drive the Address lines when the processor is reading an instruction. Depending on the Instruction read, it will normally advance the Program Counter one or more times to read the operands that the instruction requires, if any.

    At a lower level, the process is something like this.
    There are external clocks, and internal clocks, which you don't see. To read memory would require driving the address lines, and then the read cycle of the memory clock would occur and the memory would drive the data lines with the values of the bits at that address in memory. The processor would capture (sample) the data lines to capture the value of the bits in an internal register, i.e. an Instruction register. Microcode within the processor would then act on the instruction read, perhaps involving doing another memory read (e.g. a LDA instruction), or doing a memory Write (e.g. a STA instruction). Of course, either of those instructions would often first require more memory reads first to possibly get the address of where to read from, or where to write to.

    Probably your best resource for investigating this would be looking for some sources on microprocessor design.

    I had to learn how a particular computer worked at the transistor level many years ago (that computer's construction predated the use of microchips), and did learn a bit later on a computer that did use chips, and actually exposed the micro-instruction code and registers that were built into the processing unit that "emulated" the computer (the instructions that are define for the computer that the programmer would use). But that is early sixties technology and early 70's technology, and neither of those computers used byte address memory. The one computer had 18-bits at each address, so read and wrote 18-bits at a time to the memory. The later computer was a 16-bit computer, but again had 16-bits at each memory address, reading and writing 16-bits at a time.

    It was a bit of a shock for me the first time I came across a 16-bit computer (the LSI-11) and found out each address contained only 8-bits of memory, instead of 16, and when you processed an instruction, the program counter would be incremented by several addresses to get to the next instruction, rather than just one address. Of course, byte addressing is the norm now.

  3. #3
    Hyperactive Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    504

    Re: [Serious] How do old chips work?

    16-bit computer (the LSI-11)
    Ah, the good old days! I used to program these DEC computers (LSI/PDP etc) in assembler. In its day IMO these had one of the best instruction sets around.
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++17 Compiler: Microsoft VS2017 (15.7.4)

  4. #4
    PowerPoster
    Join Date
    Jun 2013
    Posts
    3,640

    Re: [Serious] How do old chips work?

    Quote Originally Posted by Jacob Roman View Post
    How are instructions fed into it, and what addresses are outputed? Is it the address you are working on? Is it the new address?
    On: http://www.happytrees.org/chips?page...h&part=RP2A03G
    there's a quite good (and not too long) "summary-datasheet": http://www.happytrees.org/main-files..._reference.txt

    Maybe that helps.

    Olaf

  5. #5

    Thread Starter
    Android OpenGL ES Guru Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,220

    Re: [Serious] How do old chips work?

    http://www.reocities.com/SiliconVall...2/6502prj1.htm

    I found this too. A 6502 project using breadboards. So when you do something like the instruction Load Accumulator (LDA), which is A9 in hexadecimal, it increments one program counter. The argument which is the value you want it to load, is then the next part of the program counter, such as #$FF. It would then look like this:

    Code:
    Address:
    00000000 00000000: 10101001 (A9) ;LDA #$FF
    00000000 00000001: 11111111 (FF)
    As for the A# pins, I dont know if thats the program counter or the address its on.

  6. #6
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    4,476

    Re: [Serious] How do old chips work?

    The A# pins are used to address memory. There are internal latched registers that drive the pins.
    The program counter is just one register that can be latched into the address registers that drive the pins.
    Other registers can be used to create an address through an internal data bus, such as the two Index registers (X,Y) the Stack pointer, as well as the ALU (Arithmetic Logic Unit).

    Perhaps this site where someone wanted to build their own 6502 using TTL logic chips would offer some insight. I haven't read through it, but it does have the person's derived schematic diagram of the 6502 based on the architectural diagram provided in datasheets and books like the one(s) I have somewhere.

    I looked on my bookshelves for 6502 processor books but they must be packed away somewhere. The oldest processor book I could fine was for the Z80.
    Last edited by passel; Jan 1st, 2018 at 10:26 PM.

  7. #7

    Thread Starter
    Android OpenGL ES Guru Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,220

    Re: [Serious] How do old chips work?

    Im thinking of building a 6502 kit myself to get a better understanding of what im doing so i can program it right. Basically im redoing my nes emulator from scratch to emulate it as flawless as possible. So far my 6502 code is spot on but im also gonna have values from the pinouts shown as well.

  8. #8
    Hyperactive Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    504

    Re: [Serious] How do old chips work?

    Quote Originally Posted by passel View Post
    The A# pins are used to address memory. There are internal latched registers that drive the pins.
    The program counter is just one register that can be latched into the address registers that drive the pins.
    Other registers can be used to create an address through an internal data bus, such as the two Index registers (X,Y) the Stack pointer, as well as the ALU (Arithmetic Logic Unit).

    Perhaps this site where someone wanted to build their own 6502 using TTL logic chips would offer some insight. I haven't read through it, but it does have the person's derived schematic diagram of the 6502 based on the architectural diagram provided in datasheets and books like the one(s) I have somewhere.

    I looked on my bookshelves for 6502 processor books but they must be packed away somewhere. The oldest processor book I could fine was for the Z80.
    I've dug out my old book 'Programming the 6502' which has a chapter on hardware organisation.
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++17 Compiler: Microsoft VS2017 (15.7.4)

  9. #9
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    4,476

    Re: [Serious] How do old chips work?

    I'm pretty sure I have that book, I remember it as a white book with green lettering and drawing on the cover. I know I have a 68020 hardware book from a short class I took on 68000/20 architecture and I didn't see that book on any of the shelves, so I'm pretty sure there are a few books in boxes somewhere. I'm in my fifth house, so there are boxes of older "junk" that just never made it to the local cache.

  10. #10
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,580

    Re: [Serious] How do old chips work?

    Nothing has to be the "input" for instructions because instructions come from memory, and that has to come from whatever the fancy name for the ROM is (I think it was CHR ROM for the NES, or was that just the graphical data?) Part of executing an instruction is fetching the data at the location indicated by the PC register, that involves setting the A pins and doing something or other, maybe through the D pins. That fetches an instruction, and depending on the instruction the CPU might have to advance PC to fetch its parameters. Once the instruction and its parameters are fetched, it flips all the internal switches in such a way that either internal registers are updated, or stack memory is updated (and the internal stack register updated), or maybe even memory sent out.

    So at startup, my guess is the NES triggers some sequence on the pin that tells the chip it's being reset. That causes at the very least the stack counter and program counter registers to be reset to a known value.

    The CPU fetch cycle in terms of hardware is probably like:

    1. Set address pins to the PC value.
    2. Read.
    3. (Optional) For instructions with parameters, (1) and (2) may repeat a time or two.
    4. Executing the instruction may involve more reading.
    5. If the instruction was something like JSR, the PC has a new value. Otherwise, increment PC.
    6. Repeat.


    So let's say we want to execute an lda with immediate addressing. In software we'd say:
    1. Read the next instruction.
    2. It's 0xA9, which is "load into accumulator A with immediate addressing". So the next byte is an 8-bit value to load into A.
    3. Read the next byte.
    4. Move that byte value into A.


    In hardware I guess it looks like:
    1. Set the A pins to the current PC value.
    2. Increment the PC value.
    3. Read the D pins to get the instruction byte.
    4. It is 0xA9, which causes us to:
      1. Set the A pins to the current PC value.
      2. Increment the PC value.
      3. Transfer the value at the D pins to the A register.

    I could be dead wrong, but that's my read. Your "input" to the CPU is always memory. The A pins control which byte will be present on the D pins when read. Physically speaking, the A pins are sort of like switches on train tracks controlling which cell of memory points to the memory bus, which is really just 8 individual pins. So the programmer's job is to place startup instructions at that specific address.

    Each instruction has its own separate sub-list of things it does in response. It may have to make more reads, update other registers, write to memory, etc.

    But the CPU can only really point to a memory cell then read or write it via those pins. So the way it "works" is to point at an instruction, read it, then perform several other reads/writes based on the instruction.
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

  11. #11

    Thread Starter
    Android OpenGL ES Guru Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,220

    Re: [Serious] How do old chips work?

    It was from the PRGROM actually. The CHRROM was the graphical data such as tiles and sprites. I guess im gonna have to program it to call the same function once twice or even 3 times depending on how many arguements it has to simulate feeding data into the chip and showing the results.

  12. #12
    Hyperactive Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    504

    Re: [Serious] How do old chips work?

    Quote Originally Posted by passel View Post
    I'm pretty sure I have that book, I remember it as a white book with green lettering and drawing on the cover. I know I have a 68020 hardware book from a short class I took on 68000/20 architecture and I didn't see that book on any of the shelves, so I'm pretty sure there are a few books in boxes somewhere. I'm in my fifth house, so there are boxes of older "junk" that just never made it to the local cache.
    Attached copy of covers of my 6502 book.
    Attached Images Attached Images  
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++17 Compiler: Microsoft VS2017 (15.7.4)

  13. #13
    PowerPoster
    Join Date
    Feb 2006
    Posts
    18,858

    Re: [Serious] How do old chips work?

    The "old chips" work just like the "new chips" do. There is no magic.

  14. #14
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,580

    Re: [Serious] How do old chips work?

    Quote Originally Posted by Jacob Roman View Post
    It was from the PRGROM actually. The CHRROM was the graphical data such as tiles and sprites. I guess im gonna have to program it to call the same function once twice or even 3 times depending on how many arguements it has to simulate feeding data into the chip and showing the results.
    There's no benefit to writing emulators that simulate how the hardware works other than "fun".

    In software, the execute cycle looks like:
    Code:
    execute()
        PC = <some startup value>
        while(true)
            instruction := memory[PC]
            PC := PC + 1
            do_instruction(instruction)
    For the LDA with immediate addressing above, do_instruction might look like:
    Code:
    do_instruction(opcode)
        switch(opcode)
            ...
            case 0xA9:
                // LDA immediate
                address := memory[PC]
                PC := PC + 1
    
                A := memory[address]
            ...
    In this case "read" just means "fetch a value from the memory array". It'd be frivolous to go through the motion of setting pin values!
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

  15. #15

    Thread Starter
    Android OpenGL ES Guru Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,220

    Re: [Serious] How do old chips work?

    Quote Originally Posted by Sitten Spynne View Post
    There's no benefit to writing emulators that simulate how the hardware works other than "fun".

    In software, the execute cycle looks like:
    Code:
    execute()
        PC = <some startup value>
        while(true)
            instruction := memory[PC]
            PC := PC + 1
            do_instruction(instruction)
    For the LDA with immediate addressing above, do_instruction might look like:
    Code:
    do_instruction(opcode)
        switch(opcode)
            ...
            case 0xA9:
                // LDA immediate
                address := memory[PC]
                PC := PC + 1
    
                A := memory[address]
            ...
    In this case "read" just means "fetch a value from the memory array". It'd be frivolous to go through the motion of setting pin values!
    I wanted to do it out of curiosity actually, but in a sense its considered fun :P. I already created my super 6502 class, as well as an NES emulator in 2 different programming languages. But I have yet to see an NES emulator show pinout readings

  16. #16
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,968

    Re: [Serious] How do old chips work?

    you can emulate the address pin-outs by updating them with the address every time you access memory.
    Imagine what it would be like to set breakpoints in, or step through subclassing code;
    and then being able to hit stop/end/debug or continue, without crashing the IDE.

    VB6.tlb | Bulletproof Subclassing in the IDE (no thunks/assembly/DEP issues)

  17. #17
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    4,476

    Re: [Serious] How do old chips work?

    I did add an image to another post that seems somewhat applicable here.
    In the image below you can see how the bits of some of the registers or buses were brought out to the front panel of the computer. In particular, the computer on the right was one of the first popular home computer kits in the late 1970s era. You can see plainly that the Address pins (bus) were brought out to the lower set of leds and your data pins (bus) were displayed in the upper row. You often had to enter an address in the lower row and data in the upper row, save and increment and repeat to either load some initial startup code, or to select a starting address to kick off a routine that was stored in ROM to get the computer going.

    The bits on the right computer were divided into groups of four so you could easily translate hex digits into the four bit binary representation needed to input the values.

    You can see that the computer on the right had its buttons group in threes, and you would use octal instead of hex to make dealing with binary easier.

    When running the lights on the front panel would all be flashing rapidly as they reflected the state of the bits in the register dynamically. At least I know that is true for the computer on the left, as I worked with similar UNIVAC computers like that in the past. Those are buttons with lights in them, so the lights directly indicated the state of the bits they were connected to as the program ran. A drawback to that design was since the buttons were directly connected to the bits of the register you could easily crash the program that was running by pressing some of the buttons, which would be essentially "stuck" bits in the register, changing the value of the data read or written to the register, or bus being displayed as the program ran.

    I don't know if the computer on the right had the same issue, or whether the switches were buffered and had no effect on a running program.
    Attached Images Attached Images  

  18. #18

    Thread Starter
    Android OpenGL ES Guru Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,220

    Re: [Serious] How do old chips work?

    If you all don't mind, I'm gonna share the super class I have written so far. I haven't made it to where it extracts the individual pinouts yet but it's nearly set up.

    [EDIT] I also am not sure if the memory map is presetup inside the CPU already or is extracted from another chip. All the websites keep saying "CPU Memory Map." Not sure if it can be changed, reprogrammed, or what. Hell Im not even sure if its really mapped in the CPU. Odds are it's gotta be a RAM chip since there's constantly data being changed throughout the entire memory map. I'm pretty sure this is not part of the CPU:

    Code:
      0000h-07FFh   Internal 2K Work RAM (mirrored to 800h-1FFFh)
      2000h-2007h   Internal PPU Registers (mirrored to 2008h-3FFFh)
      4000h-4017h   Internal APU Registers
      4018h-5FFFh   Cartridge Expansion Area almost 8K
      6000h-7FFFh   Cartridge SRAM Area 8K
      8000h-FFFFh   Cartridge PRG-ROM Area 32K
    Plus it would be cool to map your own memory locations. I also found this:

    https://en.wikipedia.org/wiki/Memory-mapped_I/O

    but it doesn't really say where it's mapped at.
    Attached Files Attached Files

  19. #19
    Hyperactive Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    504

    Re: [Serious] How do old chips work?

    I also am not sure if the memory map is presetup inside the CPU already or is extracted from another chip.
    As far as I remember, the memory map was a function of the hardware design surrounding the cpu and the used OS. Certain assumptions re memory relate to the cpu (eg page 0 memory), but within the memory addressable range usage was down to the hardware/os design.
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++17 Compiler: Microsoft VS2017 (15.7.4)

  20. #20
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,580

    Re: [Serious] How do old chips work?

    The memory and the CPU are separate.

    CPU is one chip. The only memory it has are its registers.

    There's some chip somewhere that acts as a memory controller. Its job is to take the CPU's address outputs as input, then rearrange its circuitry so the appropriate thing is mapped to the CPU's input bus. So there's 2K of actual RAM, then the rest of the 64k of addressable "memory" represents several different things based on this memory map.

    So if you address 0x0000 through 0x07FF, the memory controller routes you to addresses inside the RAM chip. This RAM is "mirrored" over the next 2K, 0x0800 through 0x1FFF. That just means if the CPU accesses 0x0000, the memory controller does the same thing it'd do if the CPU tried to access 0x0800. So it "looks like" there's 4K of RAM here but it's 2K with 2 addresses per byte.

    The PPU is its own chip, and it has its own internal memory. Some of that memory is used to control how the PPU behaves so we call them "registers". For the CPU to access that, the memory controller maps the addresses from 0x2000 through 0x2007 to those PPU memory locations. Those registers also get mirrored, this time over a pretty large range from 0x2008 through 0x3FFF. Again, this makes it look like there's a ton of memory locations but only 8 bytes of that 8k block is actual memory!

    The APU is also its own chip, and has registers just like the PPU. The memory controller maps 0x4000 through 0x4017 to those registers, with no mirroring.

    Everything beyond that is simple. 0x4018-0x5FFF is directed to the "expansion area" of the cartridge. 0x6000-0x7FFF is mapped to the SRAM area of the cartridge, which may or may not exist. The rest of memory maps directly to 32K of ROM expected to exist on the catridge.

    The CPU has nothing to do with this. It's all on the memory controller. All the CPU knows is "I have 16 bits of address bus and 8 bits of data bus." It knows "if I set the address bus to an address, I should be able to read from my data pins".

    So in software, if you wanted to simulate it as a separate class, the memory controller is basically a big switch statement. It takes the address pins as input. Based on that input, it's going to choose to map into:
    • RAM
    • The PPU registers
    • The APU registers
    • The cartridge.

    There might be other hardware between the memory controller and those banks. They probably each have their own addressing logic. That's not really documented in most emulator references. Generally when you're emulating the CPU, you only care about what the CPU cares about: "I need to be able to address a 16-bit memory space". The details of how that memory space is set up are arbitrary and up to the hardware the CPU is connected to.

    That's another reason people don't emulate at the hardware level. If you go for 'just software emulation' you can make a nice, flat 32K array. The CPU, PPU, APU, and cartridge logic can all share that array and look to the relevant positions. For example, your PPU logic knows to go look at 0x2000-0x2007 for its registers because that's where the CPU writes them.

    But if you want hardware accuracy, you can't do that. You have to make a 2K array that represents RAM, your PPU needs a 7-byte array that represents its registers, etc. All of these separate units need to communicate with the memory controller not via nice neat variables, but address lines. It's a situation where you end up writing more "how to do it" than "what I want to do".
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

  21. #21
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,968

    Re: [Serious] How do old chips work?

    Quote Originally Posted by 2kaud View Post
    As far as I remember, the memory map was a function of the hardware design surrounding the cpu and the used OS. Certain assumptions re memory relate to the cpu (eg page 0 memory), but within the memory addressable range usage was down to the hardware/os design.
    exactly. you can even have address lines tied to each other... which results in "mirroring". you're not actually looking at a mirror - it's just the address gets you to the same memory.
    Imagine what it would be like to set breakpoints in, or step through subclassing code;
    and then being able to hit stop/end/debug or continue, without crashing the IDE.

    VB6.tlb | Bulletproof Subclassing in the IDE (no thunks/assembly/DEP issues)

  22. #22
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    4,476

    Re: [Serious] How do old chips work?

    The address lines don't necessarily need to be tied together. Usually a device may just decode a subset of the address lines. If a device is only decoding the lower eight bits, then the 256 byte address space it is decoding could be essentially mapped 256 times as the upper eight bits are ignored in the address selection.

  23. #23

    Thread Starter
    Android OpenGL ES Guru Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,220

    Re: [Serious] How do old chips work?

    I found this awesome video on how a cpu works
    https://youtu.be/cNN_tTXABUA

  24. #24
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,968

    Re: [Serious] How do old chips work?

    Quote Originally Posted by passel View Post
    The address lines don't necessarily need to be tied together. Usually a device may just decode a subset of the address lines. If a device is only decoding the lower eight bits, then the 256 byte address space it is decoding could be essentially mapped 256 times as the upper eight bits are ignored in the address selection.
    ah! that's actually a lot more accurate. a subset of the the address lines aren't even hooked up...

    You would never know I'm an EE concentration computer architecture...
    Imagine what it would be like to set breakpoints in, or step through subclassing code;
    and then being able to hit stop/end/debug or continue, without crashing the IDE.

    VB6.tlb | Bulletproof Subclassing in the IDE (no thunks/assembly/DEP issues)

  25. #25
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    4,476

    Re: [Serious] How do old chips work?

    Quote Originally Posted by Jacob Roman View Post
    I found this awesome video on how a cpu works
    https://youtu.be/cNN_tTXABUA
    That seems like a reasonable lesson.
    It is actually a higher level than I originally had to learn when I was learning the basics of how a computer works.
    The level I started with were more along the lines of this video, i.e. how transistors are configured to create logic gates, and how logic gates are combined to create registers, adders, flip-flops, boolean logic, etc... and then how those registers, adders, flip-flops, etc... were combined to create the ALU and CPU and other components of the computer.

  26. #26

    Thread Starter
    Android OpenGL ES Guru Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,220

    Re: [Serious] How do old chips work?

    I especially like the part of the video that shows that the cpu is sending out the address to RAM first through the address bus, and RAM spits out the data from that address back to the cpu through the data bus which could be an instruction or data depending on the opcode and how many arguments they have, kinda like a cycle. Unless there is a write to RAM then the cpu sends the written data to the RAM through the databus side. Then it goes to the next address and does the same thing, over and over. Although addresses are sometimes sequential, the RAM is random access memory, so sometimes there could be a jump to a certain address.

    Lately besides the NES emulator I decided to jump back to, I was writing emulators in C++ for other consoles, namely being Gameboy, Genesis, and the CD-I (just the cpu at the moment). But was writing it in a similar fashion as I did my NES cpu. The Gameboy uses a DMG-CPU (Licensed by Nintendo) which is actually a Sharp LR35902, which uses the same instructions as a z80 or an Intel 8080. The Genesis uses a Motorola 68000. And the CD-I uses something similar to the Genesis only its the Motorola 68341 which actually uses the same instructions as a Motorola 68020. And since CD-I emulation isn't done too much I decided to write one to see if I can get one working. The very first step to any emulator is to write out the CPU because that is needed to load things into the memory map of the hardware such as VRAM, controls, I/O, etc.

  27. #27
    Hyperactive Member Arve K.'s Avatar
    Join Date
    Sep 2008
    Location
    Kyrksæterøra, Norway
    Posts
    466

    Re: [Serious] How do old chips work?

    Name:  b1340b41d010ec44601fab5b686c59ae91c7818c7a92c4771d8b52cf0b5d3421.jpg
Views: 81
Size:  31.0 KB
    Arve K.

    Please mark your thread as resolved and add reputation to those who helped you solve your problem
    Disclaimer: I am not a professional programmer

  28. #28
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    4,289

    Re: [Serious] How do old chips work?

    Actually, years ago, a friend and I built a latch/bridge between a TRS80-Model-I and an S100 bus system to port the old ROM based OS out of the TRS80. We actually managed to get things patched up well enough to get the "OK" prompt on the S100 bus system.

    However, for me, it all starts with the understanding of what a transistor is, and what a memory cell is, and how you can take transistors and build a memory cell, recognizing that electrons actually don't travel at instantaneous speeds.

    From there, it's just a matter of using this to design latches, buffers, and gates. And we're off and running.

    Basically, since the first transistor-type concept...

    Name:  transistor.png
Views: 56
Size:  160.0 KB

    ...nothing "fundamental" has changed. We've just gotten monumentally better at making transistors smaller. The rest is essentially programming, although not exactly software.

    IMHO, we really won't see anything significantly different from something like Turing designed (and all of his ideas, here, here, and here) until we get q-bits going (and available to the masses). That's when we need to start worrying about AI getting tired of us.

    Until then, it's just us fumbling with our own machines, not knowing how to use them.
    Last edited by Elroy; Jan 23rd, 2018 at 06:45 PM.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width


×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.