Week 2 Flashcards
n-bit processors?
n-bit processor indicates it has an n-bit ALU. The ALU decides how much data can be processed at a time. A 16-bit ALU can process 16 bits of data at a time
Data Bus
-Transfers data
-Width determines how much data can be transferred at a time in one cycle
-The wider the data bus, the more data can be transferred in one cycle so less number of cycles required and a faster processor.
Control Bus
-Carries control signals
-Control signals include:
-Selection of memory or I/O devices
-Direction of data transfer
-Synchronisation of data transfer
Address Bus
Address bus transfers data .
1 wire can address 2 locations.
Intel 8086 has a 20-bit address bus so can address 2^20 locations
How many bits in one byte
8 bits in one byte
One memory location stores on byte of data
2^N locations can store 2^N bytes of data
How is data “2023H” stored in memory?
Its stored as 2 bytes. Instead of one 2023H being stored as one, a 20H and a 23H is stored separately. One memory cell can store 8 bits maximum.
Whats the little endian rule?
Its a type of addressing that refers to the order of data stored in memory.
The LSB is first stored and subsequent bits are stored incrementally.
In other words, the lower byte of data are stored at the lower byte of memory
To transfer the data 2023H to memory using 16 bit data bus…?
2 memory locations need to be accessed. In one cycle, 2 addresses can be transferred by the address bus. Therefore we need 2 cycles to transfer 2023H
What is memory banking? (16 bit 8086)
Goal is to access two consecutive memory locations in one cycle (16 bits). The memory chip is equally divided into banks. Minimum byte operation needs 1 byte so 8 bits so 2 are needed for 16 bits.
Transferring data using even bank and odd bank
The two banks are even and odd. The even bank is the lower bank and the odd bank is the higher bank. Now 2 memory locations can be accessed at the same time. Each bank is connected to the processor using a tablet, using 8 wires tied together and 16 bit database. So 16 bits of data can be transferred at the same time.
Memory Banking? (32 bit 8086)
For 32 bit, four addresses need to be accessed simultaneously to obtain 32 bits of data at a time. So we need to divide the memory physically to four chip and then 32 bits can be accessed at the same time.
What is aligned/misaligned memory access?
A memory access is said to be aligned when the data being accessed is n-byte long and the datum address is n-byte aligned.
What are registers?
A temporary storage locations inside the CPU to store data/instructions/address.
Status/Flag registers
- Contains the current state of a CPU
- Checked by CPU before execution of every instruction
- Updated after every execution
- 8086 has a 16-bit flag register
- 1 bit per flag
- 7 bits unused
- 9 bit used: 6 status flags and 3 control flags
Flag purposes
- CF: carry flag is set to 1 if there is an unsigned overflow or if there is a borrow during subtraction out of the MSB
- PF: parity flag is set to 1 if result from ALU has even number of 1s
- AF: auxiliary flag is similar to CF but watches over the lower 4-bit
- ZF: zero flag is set to 1 if the result from the ALU is zero
- SF: signal flag copies to the MSB of the result from the ALU
- OF: overflow flag is set to 1 when the result is out of range/of signed operation
- TF: trap flag set to 1 to get into single step mode for debugging
- IF: interrupt flag set to 1/0 to enable/mask interrupts
- DF: flag set to 1/0 to set direction to decrementing/incrementing