Index | Fejlesztés Development | CPU | Számítógép Computer | Assembler | Monitor | Függvények Library


Lang: Nyelv: HU EN

Mikroszámítógép v1 Microcomputer v1

A mikroprocesszort kiegészítve néhány alkatrésszel, mikroszámítógépet alakítunk ki. By adding a few components to the microprocessor, we create a microcomputer.

A processzort memóriával, GPIO áramkörökkel, az eszközöket összekötő buszt pedig címdekóderrel egészítjük ki. The processor is supplemented with memory, GPIO circuits, and the bus connecting the devices is supplemented with an address decoder.

Memória Memory

A processzor memória illesztőjére (MA, MDI, MDO, MWE) kapcsolódó memória alkatrész fogja tárolni a futtatott programot, valamint a feldolgozott adatokat. A memóriát az FPGA-n alakítjuk ki, a lefordított program kódját pedig beillesztjük az alkatrészbe. Ez azt jelenti, hogy a program megváltoztatásakor a memória alkatrészt újra el kell készíteni. The memory component connected to the processor's memory interface (MA, MDI, MDO, MWE) will store the executed program and the processed data. The memory is designed on the FPGA, and the compiled program code is inserted into the component. This means that when the program changes, the memory component must be re-created.

A memória kapacitása 512 szó, a címzéshez így 9 cím bitre van szükség. Minden szó 32 bites. The memory capacity is 512 words, so 9 address bits are required for addressing. Each word is 32 bits.

GPIO

A külvilággal való kapcsolattartást a memória illesztőre kapcsolt GPIO (General Purpose Input Output) áramkörök valósítják meg. Communication with the outside world is achieved by GPIO (General Purpose Input Output) circuits connected to the memory interface.

Kimenetek Outputs

A kimeneti kivezetéseket egy 4 regiszterből álló “memória” valósítja meg, amelyből mind a 4 regiszter kimenetei ki vannak vezetve. Ezek a PORTA, PORTB, PORTC, PORTD nevet viselik. A regiszterek tartalma írható (memória írás utasítással), valamint vissza is olvasható a tartalmuk. The output pins are implemented by a "memory" consisting of 4 registers, from which the outputs of all 4 registers are derived. These are called PORTA, PORTB, PORTC, PORTD. The contents of the registers can be written (with the memory write instruction) and their contents can be read back.

A 4 regiszter 4 egymást követő címen található, a kezdőcímet a címdekóder határozza meg: The 4 registers are located at 4 consecutive addresses, the starting address is determined by the address decoder:

OffszetOffset Port
0 PORTA
1 PORTB
2 PORTC
3 PORTD

Bemenetek Inputs

Bemenetként szintén regisztert használunk. A regiszter olvasásakor a bemeneti vezetékek állapota eltárolódik a regiszterben (mintavétel), a processzor ennek a tartalmát fogja megkapni. A bemeneti GPIO áramkörben egy regiszter van, így egy 32 bites bemenő adathoz lehet vele hozzáférni. A számítógépben két ilyen áramkört kapcsolunk a buszra, így két bemeneti portot kapunk (PORTI, PORTJ). We also use a register as an input. When reading the register, the state of the input wires is stored in the register (sampling), the processor will receive its contents. The input GPIO circuit has a register, so it can access a 32-bit input data. In the computer, we connect two such circuits to the bus, so we get two input ports (PORTI, PORTJ).

Címdekóder Address decoder

A címdekóder a processzor cím kimenetének ADDR[15:12] kivezetéseit használja, így 64 Ki szó tartományban 4 Ki szavas szeleteket választ szét, egy kimenete egy 4 Ki szavas cím tartományban lesz aktív. Az eszközök a következő címeken lesznek elérhetők: The address decoder uses the processor address output ADDR[15:12] pins, thus separating 4 Ki word slices in a 64 Ki word range, one output of which will be active in a 4 Ki word address range. The devices will be available at the following addresses:

Cím tartományAddress range EszközDevice
0x0000 0000 - 0x0000 0fff MemóraMemory
0x0000 d000 - 0x0000 dfff Bemeneti port: PORTJ Input port: PORTJ
0x0000 e000 - 0x0000 efff Bemeneti port: PORTI Input port: PORTI
0x0000 f000 - 0x0000 ffff Kimeneti portok: Output ports:
0xf000: PORTA
0xf001: PORTB
0xf002: PORTC
0xf003: PORTD

Mivel a felsőbb helyi értékű cím bitek a dekódolásban nem vesznek részt, az eszközök a további 64 Ki szavas tartományokban is megjelennek. Since the high-order address bits are not involved in the decoding, the devices appear in the additional 64 Ki word ranges.

Diagnosztika Diagnostics

A CPU tesztelésre használható ki- és bemenetei a számítógépben is hozzáférhetőek. A TRS bemetekre adott 4 bites kód által meghatározott adatok megjelennek a TR és a TREG kimeneteken (részletesen lásd a mikroprocesszor leírásában). The CPU's test inputs and outputs are also accessible in the computer. Data specified by the 4-bit code given to the TRS inputs is displayed on the TR and TREG outputs (see the microprocessor description for details).