Notes
Notes
Microprocesso
r
Microprocessors and Microcontrollers
(21EC208)
IV Semester ECE
By,
Dr.S.Gandhimathi @ Usha,
Associate Professor/ECE
VCET
Course Objectives
Course
Contrib 2 1 1 --- 1 --- --- --- 1 1 --- --- 2 1
ution
21EC208/ Microprocessors and Microcontrollers
UNIT I ARCHITECTURE OF 8086 & ASSEMBLY LANGUAGE PROGRAMMING
Microprocessor Families – 8086 –Architecture – Instruction set – Addressing Modes –
Bus Cycles – Assembly Language Programming of 8086 – Assembler Directives – Interrupts
and its applications.
REFERENCES:
• V. A.K. Ray and K.M. Burchandi, “Intel Microprocessors Architecture
Programming and Interfacing”, McGraw Hill, 2000.
• Sunil Mathur, "Microprocessor 8086: Architecture, Programming and
Interfacing", PHI Learning Pvt.Ltd., 2011.
• Kenneth Ayala, "The 8051 Microcontroller”, 3rd Edition, Delmar Cengage
Learning, 2004.
Block Diagram of a Microcomputer
Introduction
Operates in two
Does not have internal clock; external modes: minimum mode and maximum
and 𝐌𝐗 pins.
asymmetric clock source with 33% mode, decided by the signal at MN
duty cycle
1
4
8086
Microprocessor Pins and Common signals
Signals
AD0-AD15 (Bidirectional)
Address/Data bus
1
5
8086
Microprocessor Pins and Common signals
Signals
BHE (Active Low)/S7 (Output)
MN/ MX
MINIMUM / MAXIMUM
hardware.
CLK
19
8086
Microprocessor Pins and Minimum mode signals
Signals
Pins 24 -31
𝐃𝐄
𝐍
(Data Enable) Output signal from the processor
used as out put enable for the transceivers
𝐈𝐎
M/ Used to differentiate memory access and I/O
access. For memory reference instructions, it is
high. For IN and OUT instructions, it is low.
𝐖
𝐑
Write control signal; asserted low Whenever
processor writes data to memory or I/O port
𝐈𝐍𝐓
𝐀
(Interrupt Acknowledge) When the interrupt
request is accepted by the processor, the output
is
low on this line.
20
8086
Microprocessor Pins and Minimum mode signals
Signals
Pins 24 -31
21
8086
Microprocessor Pins and Maximum mode signals
Signals
During maximum mode operation, the MN/ 𝐌𝐗
is grounded (logic low)
𝑺 𝟎,
𝑺𝟏, 𝑺𝟐
Status signals; used by the 8086 bus controller to
generate bus timing and control signals. These
are decoded as shown.
22
8086
Microprocessor Pins and Maximum mode signals
Signals
During maximum mode operation, the MN/ 𝐌𝐗
is grounded (logic low)
𝑸𝑺𝟎,
𝑸𝑺𝟏
(Queue Status) The processor provides the status
of queue in these lines.
23
8086
Microprocessor Pins and Maximum mode signals
Signals
During maximum mode operation, the MN/ 𝐌𝐗
is grounded (logic low)
𝐑𝐐/𝐆𝐓𝟎,
𝐑𝐐/𝐆𝐓𝟏
(Bus Request/ Bus Grant) These requests are used
by other local bus masters to force the processor
to release the local bus at the end of
the processor’s current bus cycle.
𝐋𝐎𝐂
𝐊
An output signal activated by the LOCK prefix
instruction.
24
8086
Architecture
Microprocessor
25
8086
Microprocessor Architecture
Dedicated Adder to
generate 20 bit address
8086 registers
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
categorized
into 4 groups OF DF IF TF SF ZF AF PF CF
Segment
Registers
31
8086
Architecture Bus Interface Unit (BIU)
Microprocessor
32
8086
Architecture Bus Interface Unit (BIU)
Microprocessor
33
8086
Architecture Bus Interface Unit (BIU)
Microprocessor
34
8086
Architecture Bus Interface Unit (BIU)
Microprocessor
35
8086
Architecture Bus Interface Unit (BIU)
Microprocessor
Instruction queue
A group of First-In-First-
Out (FIFO) in which up to
6 bytes of
instruction code are
pre fetched from the
memory ahead of time.
36
8086
Architecture Execution Unit (EU)
Microprocessor
EU decodes and
executes instructions.
A decoder in the EU
control system
translates instructions.
and
Some of the 16 bit registers can
Index registers (Source be used as two 8 bit registers as
Index, Destination Index) :
each of 16-bits AX can be used as AH and AL
BX can be used as BH and BL
CX can be used as CH and CL 27
DX can be used as DH and
8086
Architecture Execution Unit (EU)
Microprocessor
38
8086
Architecture Execution Unit (EU)
Microprocessor
39
8086
Architecture Execution Unit (EU)
Microprocessor
Example:
40
8086
Architecture Execution Unit (EU)
Microprocessor
41
8086
Architecture Execution Unit (EU)
Microprocessor
42
8086
Architecture Execution Unit (EU)
Microprocessor
43
8086
Architecture Execution Unit (EU)
Microprocessor
44
8086
Architecture Execution Unit (EU)
Microprocessor
Auxiliary Carry Flag
Carry Flag
Flag Register This is set, if there is a carry from the
This flag is set, when there is
lowest nibble, i.e, bit three during
addition, or borrow for the lowest a carry out of MSB in case of
nibble, i.e, bit three, during addition or a borrow in case
subtraction. of subtraction.
This flag is set, when the This flag is set, if the result of This flag is set to 1, if the lower
result of any computation the computation or comparison byte of the result contains even
is negative performed by an instruction is number of 1’s ; for odd number
zero of 1’s set to zero.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OF DF IF TF SF ZF AF PF CF
Tarp Flag
Over flow Flag If this flag is set, the processor
This flag is set, if an overflow occurs, i.e, if the result of a signed enters the single step execution
operation is large enough to accommodate in a destination
mode by generating internal
register. The result is of more than 7-bits in size in case of 8-bit
signed operation and more than 15-bits in size in case of 16-bit interrupts after the execution of
sign operations, then the overflow will be set. each instruction
Program
A set of instructions written to solve
a problem.
Instruction
Directions which a microprocessor
follows to execute a task or part of
a task.
Computer language
1. Register
Addressing
Group I : Addressing modes for
2. Immediate Addressing register and immediate data
3. Direct Addressing
5. Based Addressing
Group II : Addressing modes for
6. Indexed Addressing memory data
7. Based Index Addressing
8. String Addressing
8. String Addressing
41
8086 Group I : Addressing modes for
Microprocessor Addressing register and immediate
Modes data
1. Register
Addressing In immediate addressing mode, an 8-bit or 16-bit
2. Immediate Addressing data is specified as part of the instruction
3. Direct Addressing
Example:
4. Register Indirect Addressing
MOV DL, 08H
5. Based Addressing
The 8-bit data (08H) given in the instruction is
6. Indexed Addressing moved to DL
8. String
Addressing MOV AX, 0A9FH
9. Direct I/O port Addressing
The 16-bit data (0A9FH) given in the instruction is
10. Indirect I/O port Addressing
moved to AX register
11. Relative Addressing
(AX) 0A9FH
12. Implied Addressing
42
8086
Microprocessor Addressing Modes : Memory
Access
20 Address lines 8086 can address up to
220 = 1M bytes of memory
2. Immediate Addressing
Here, the effective address of the
3. Direct Addressing
memory location at which the data operand is
4. Register Indirect Addressing stored is given in the instruction.
46
Group II : Addressing modes
8086 Addressing Modes
Microprocessor for memory data
(CL) (MA)
(CH) (MA +1) 47
8086 Group II : Addressing modes
Microprocessor Addressing for memory data
Modes
1. Register In Based Addressing, BX or BP is used to hold
Addressing base value for effective addressthe
and a signed 8-
2. Immediate Addressing bit
or unsigned 16-bit displacement will be specified
in the instruction.
3. Direct Addressing
In case of 8-bit displacement, it is sign extended
4. Register Indirect Addressing to 16-bit before adding to the base value.
(AL) (MA)
48
(AH) (MA + 1)
8086 Group II : Addressing modes
Microprocessor Addressing for memory data
Modes
1. Register SI or DI register is used to hold an index value for
Addressing memory data and a signed 8-bit or unsigned 16-
2. Immediate Addressing bit displacement will be specified in
the instruction.
3. Direct Addressing
Displacement is added to the index value in SI or
4. Register Indirect Addressing DI register to obtain the EA.
(CL) (MA)
(CH) (MA + 1)
49
8086 Group II : Addressing modes
Microprocessor Addressing for memory data
Modes
1. Register In Based Index Addressing, the effective address
Addressing is computed from the sum of a base register
2. Immediate Addressing (BX or BP), an index register (SI or DI)
and a displacement.
3. Direct Addressing
Example:
4. Register Indirect Addressing
MOV DX, [BX + SI + 0AH]
5. Based Addressing
Operations:
6. Indexed Addressing
000AH 0AH (Sign extended)
7. Based Index Addressing
50
8086 Group II : Addressing modes
Microprocessor Addressing for memory data
Modes
1. Register Employed in string operations to operate on
Addressing string data.
2. Immediate Addressing
The effective address (EA) of source data is
3. Direct Addressing stored in SI register and the EA of destination is
stored in DI register.
4. Register Indirect Addressing
Segment register for calculating base address of
5. Based Addressing source data is DS and that of the destination
data is ES
6. Indexed Addressing
1. Register Addressing
2. Immediate Addressing
1. Register Addressing
2. Immediate Addressing
3. Direct Addressing
5. Based Addressing
6. Indexed Addressing
Instructions using this mode have no operands.
The instruction itself will specify the data to
7. Based Index Addressing
be operated by the instruction.
8. String
Addressing Example: CLC
9. Direct I/O port Addressing
This clears the carry flag to
10. Indirect I/O port Addressing zero.
54
INSTRUCTION
SET
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
3. Logical Instructions
56
8086
Microprocessor Instruction Set
57
8086
Microprocessor Instruction Set
58
8086
Microprocessor Instruction Set
AX
60
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
ADD A, data
61
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
ADDC A, data
62
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
SUB A, data
63
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
SBB A, data
64
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
65
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
66
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
69
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
70
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
CMP A, data
71
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
72
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
73
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
74
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
75
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
76
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
77
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
78
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
79
8086
Microprocessor Instruction Set
80
8086
Microprocessor Instruction Set
REP
81
8086
Microprocessor Instruction Set
MOVS
(MAE) (MA)
82
8086
Microprocessor Instruction Set
CMPS
83
8086
Microprocessor Instruction Set
SCASW
MAE = (ES) x 1610 + (DI)
Modify flags (AL) - (MAE)
LODS
85
8086
Microprocessor Instruction Set
STOS
86
8086
Microprocessor Instruction Set
CLC Clear CF 0
NOP No operation
Mnemonics Explanation
CALL reg/ mem/ disp16 Call subroutine
88
8086
Microprocessor Instruction Set
Checks flags
89
8086
Microprocessor Instruction Set
JC disp8 Jump if CF = 1
JP disp8 Jump if PF = 1
JO disp8 Jump if OF = 1
JS disp8 Jump if SF = 1
91
Assembl directiv
er es
8086
Microprocessor Assemble
Directives
instructions’ Used to :
› specify the start and end of a
program
› attach value to variables
› allocate storage locations to
input/ output data
› define start and end of
segments, procedures, macros
etc..
93
8086
Microprocessor Assemble
Directives
DB Define Byte
PROC
FAR Example:
NEAR LIST DB 7FH, 42H, 35H
ENDP
Three consecutive memory locations are reserved for
SHORT the variable LIST and each data specified in
the instruction are stored as initial value in the
MACRO reserved memory location
ENDM 94
8086
Microprocessor Assemble
Directives
DB Define Word
PROC
FAR Example:
NEAR ALIST DW 6512H, 0F251H, 0CDE2H
ENDP
Six consecutive memory locations are reserved for
SHORT the variable ALIST and each 16-bit data specified in
the instruction is stored in two consecutive memory
MACRO location.
ENDM 95
8086
Microprocessor Assemble
Directives
DB SEGMENT : Used to indicate the beginning
of
DW a code/ data/ stack segment
ENDS : Used to indicate the end of a code/
SEGMENT data/ stack segment
ENDS
General form:
ASSUME
ORG
END Segnam SEGMENT
EVEN …
EQU … Program code
… or
PROC … Data Defining
… Statements
FAR …
NEAR
Segnam ENDS
ENDP
SHOR
T
MACRO User defined name of
the segment
ENDM 96
8086
Microprocessor Assemble
Directives
DB Informs the assembler the name of the
program/ data segment that should be used
DW for a specific segment.
PROC Example:
FAR
NEAR ASSUME CS: ACODE, DS:ADATA Tells the compiler that the
ENDP instructions of the program are
stored in the segment ACODE and
data are stored in the
SHORT segment ADATA
MACRO
ENDM 97
8086
Microprocessor Assemble
Directives
ORG (Origin) is used to assign the starting
DB
address (Effective address) for a program/ data
segment
DW END is used to terminate a program;
statements after END will be ignored
SEGMENT
ENDS EVEN : Informs the assembler to store program/
data segment starting from an even address
ASSUME
EQU (Equate) is used to attach a value to a
variable
ORG
Examples:
END
EVEN ORG 1000H Informs the assembler that the statements
EQU following ORG 1000H should be stored in
memory starting with effective address
1000H
PROC
FAR
LOOP EQU 10FEH Value of variable LOOP is 10FEH
NEAR
ENDP
_SDATA SEGMENT In this data segment, effective address of
SHOR ORG 1200H memory location assigned to A will be 1200H
A DB 4CH and that of B will be 1202H and 1203H.
T EVEN
B DW
MACRO 1052H 98
_SDATA ENDS
ENDM
8086
Microprocessor Assemble
Directives
PROC Indicates the beginning of a
DB
procedure
ENDP End of
DW procedure
FAR Intersegment call
SEGMENT
ENDS NEAR Intrasegment call
General form
ASSUME
ORG
procname PROC[NEAR/ FAR]
END
EVEN …
Program statements of the
…
EQU … procedure
Last statement of
PROC RET
the procedure
ENDP
FAR procname ENDP
NEAR
RET
ORG ADD64 ENDP
END
EVEN
EQU CONVERT PROC FAR The subroutine/ procedure named CONVERT
is declared as FAR and so the assembler will
… code the CALL and RET instructions involved
PROC … in this procedure as far call and return
ENDP …
FAR RET
NEAR CONVERT ENDP
SHOR
T
MACRO
ENDM 100
8086
Microprocessor Assemble
Directives
DB Reserves one memory location for 8-bit
signed displacement in jump instructions
DW
Example:
SEGMENT
ENDS
PROC
ENDP
FAR
NEAR
SHORT
MACRO
ENDM 101
8086
Microprocessor Assemble
Directives
DB MACRO Indicate the beginning of a macro
PROC
ENDP
FAR User defined name of
NEAR the macro
SHORT
MACRO
ENDM 102
Interfacing memory
and i/o ports
8086
Microprocessor Memory
Processor Memory
Registers inside a microcomputer
Store data and results
temporarily
No speed disparity
Cost
8086 : 16-bit
Bank 0 : A0 = 0
Even addressed memory
bank
Bank 1 : 𝑩𝑯𝑬 = 0
Odd addressed
memory bank
106
8086
Microprocessor Memory organization in 8086
𝑩𝑯
𝑬
Operation A0 Data Lines Used
108
8086
Microprocessor Interfacing SRAM and EPROM
EPROM Read
operations RAM
109
8086
Microprocessor Interfacing SRAM and EPROM
110
8086
Microprocessor Interfacing SRAM and EPROM
111
8086
Microprocessor Interfacing SRAM and EPROM
Monitor Programs
Programing 8279 for keyboard scanning and display
refreshing
Initialization of stack
112
8086
Microprocessor Interfacing I/O and peripheral devices
I/O devices
For communication between microprocessor and
outside world
Ports / Buffer IC’s
Microprocessor I/ O devices
(interface circuitry)
Interrupt driven I/ O
I/O device interrupts the
processor and initiate
data transfer
Direct memory access
Data transfer is achieved by 113
bypassing the
8086
Microprocessor 8086 and 8088 comparison
The I/O ports or peripherals can be Only IN and OUT instructions can be
treated like memory locations and used for data transfer between I/O
so all instructions related to device and processor
memory can be used for data
transmission between I/O device
and processor
Data can be moved from any Data transfer takes place only
register to ports and vice between accumulator and
versa ports
When memory mapping is used Full memory space can be used for
for I/O devices, full memory addressing memory.
address space cannot be used for
addressing memory. Suitable for systems which
require large memory capacity
Useful only for small systems
where memory requirement is
less
For accessing the memory For accessing the I/O mapped
mapped devices, the processor devices, the processor executes I/O
executes memory read or write read or write cycle.
M / 𝐈𝐎 is asserted low
cycle. 4
Largest
Number
MOV SI, 5000 MOV AL, [SI]
DEC CL
INC SI
JNC SVEC
ASCENDING ORDER
DEC SI
MOV CL, [SI]
JC SVEW
Smallest
Number
MOV SI, 5000 MOV AL, [SI]
DEC CL
INC SI
JC SVEC
DESCENDING ORDER
DEC SI
MOV CL, [SI]
JNC SVEW
Factorial
SVEW: MUL CX
LOOP SVEW
MOV [6000], AX
MOV [6002], DX
HLT
Fibonacci sequence
MOV [SI], AL
MOV [SI], AL
ADD SI, 01H
LOOP L1
ADD AL, 01H
HLT
MOV [SI], AL
MOV [SI], AL
MOV [SI], AL
ADD SI, 01H
LOOP L1
ADD AL, 01H
HLT
MOV [SI], AL
MOV CL,05H
MOV SI,1100H
MOV DI,1200H
CLD
L1 MOVSB
LOOP L1
HLT
8255 PPI
8255 PPI
Register selection
S’ A1 A0 Selection Address
0 0 0 PORT A 80 H
0 0 1 PORT B 81 H
0 1 0 PORT C 82 H
0 1 1 Control 83 H
Register
1 X X No Seletion X
PPI 8255 CONTROL WORD
CWR FORMATE
8255 PPI PIN DIAGRAM
8255 FEATURES
The port A lines are identified by symbols PA0-PA7 while the port C lines are
Identified as PC4-PC7.
Similarly, Group B contains an 8-bit port B, containing lines PB0-PB7 and a 4-bit
port C with lower bits PC0- PC3.
The port C upper and port C lower can be used in combination as an 8-bit port C.
Both the port C is assigned the same address.
Thus one may have either three 8-bit I/O ports or two 8-bit and two 4-bit ports
from 8255.
All of these ports can function independently either as input or as output ports.
This can be achieved by programming the bits of an internal register of 8255
called as control word register (CWR).
Modes of 8255
In I/O mode, the 8255 ports work as programmable I/O ports, while in BSR mode only
port C (PC0-PC7) can be used to set or reset its individual port bits.
Under the I/O mode of operation, further there are three modes of operation of 8255,
so as to support different types of applications, mode 0, mode 1 and mode 2.
BSR Mode: In this mode any of the 8-bits of port C can be set or reset depending on D0
of the control word. The bit to be set or reset is selected by bit select flags D3, D2 and
D1 of the CWR as given in table.
I/O Modes:
I/O Modes:
Mode 0 (Basic I/O mode): This mode is also called as basic input/output Mode. This mode
provides simple input and output capabilities using each of the three ports. Data can be
simply read from and written to the input and output ports respectively, after appropriate
initialization.
Mode 1
Mode 1: (Strobed input/output mode ) In this mode the handshaking control the
input and output action of the specified port. Port C lines PC0-PC2, provide strobe or
handshake lines for port B.
This group which includes port B and PC0-PC2 is called as group B for Strobed data
input/output. Port C lines PC3-PC5 provides strobe lines for port A.
This group including port A and PC3-PC5 from group A. Thus port C is utilized for
generating handshake signals.
• Handshaking signals are provided to maintain proper data flow and synchronization
between the data transmitter and receiver.
OUT CWR, AL ;
OUT Port B, AL ;
OUT Port C, AL
OUT Port C, AL
DAC INTERFACING WITH 8086
DAC INTERFACING WITH 8086
DAC INTERFACING WITH 8086
DAC INTERFACING WITH 8086
A/D and D/A converter
SAWTOOTH WAVEFORM
LABEL MNEMONICS
MOV AL,80H
OUT 76,AL
START: MOV AL,0H
OUT 70H,AL
OUT 72,AL
INC AL
JMP START
DAC
LABEL MNEMONICS
MOV AL,80
OUT 76,AL
START MOV AL,00
REPEAT OUT 70,A
OUT 72,AL
INC AL
CMP AL.FF
JNZ REPEAT
MOV AL.FF
AGAIN OUT 70,AL
OUT 72,AL
DEC AL
CMP AL,00
JNZ AGAIN
JMP START
Memory interfacing to 8086
Memory interface
Memory is divided into two banks ODD and EVEN.
The data bus is 16-bits wide.
The IO/ M pin is replaced with M/ IO (8086).
Note that 8-bit read requests in this scheme are handled by the microprocessor (it
selects the bits it wants to read from the 16-bits on the bus).
Memory interfacing
Interrupt is the method of creating a temporary halt during program execution and
allows peripheral devices to access the microprocessor. The microprocessor responds to
that interrupt with an ISR (Interrupt Service Routine), which is a short program to
instruct the microprocessor on how to handle the interrupt.
The are two types of interrupts in a 8086 microprocessor.
They are hardware interrupts and software interrupts.
NMI
It is a single non-maskable interrupt pin (NMI) having higher priority than the maskable
interrupt request pin (INTR)and it is of type 2 interrupt.
• Pushes the CS (code segment) value and IP (instruction pointer) value of the return
address on to the stack.
• IP is loaded from the contents of the word location 00008H.
• CS is loaded from the contents of the next word location 0000AH.
• Interrupt flag and trap flag are reset to 0.
Interrupt structure of 8086
INTR
The INTR is a maskable interrupt because the microprocessor will be interrupted only if
interrupts are enabled using set interrupt flag instruction. It should not be enabled
using clear interrupt Flag instruction.
The INTR interrupt is activated by an I/O port. If the interrupt is enabled and NMI is
disabled, then the microprocessor first completes the current execution and sends ‘0’
on INTA pin twice. The first ‘0’ means INTA informs the external device to get ready
and during the second ‘0’ the microprocessor receives the 8 bit, say X, from the
programmable interrupt controller.
The interrupts from Type 5 to Type 31 are reserved for other advanced
microprocessors, and interrupts from 32 to Type 255 are available for hardware
and software interrupts.
Interrupts of 8086
• CS value of the return address and IP value of the return address are pushed
on to the stack.
The Block Diagram consists of 8 blocks which are – Data Bus Buffer,
Read/Write Logic, Cascade Buffer Comparator, Control Logic, Priority Resolver
and 3 registers- ISR, IRR, IMR.
Read/Write logic
This block works only when the value of pin CS is low (as this pin is active
low). This block is responsible for the flow of data depending upon the inputs
of RD and WR. These two pins are active low pins used for read and write
operations.
8259 interrupt controller
Control logic : It is the centre of the microprocessor and controls the functioning of every
block. It has pin INTR which is connected with other microprocessor for taking interrupt
request and pin INT for giving the output. If 8259 is enabled, and the other microprocessor
Interrupt flag is high then this causes the value of the output INT pin high and in this way
8259 responds to the request made by other microprocessor.
Interrupt request register (IRR) : It stores all the interrupt level which are requesting for
Interrupt services.
Interrupt service register (ISR) : It stores the interrupt level which are currently being
executed.
Interrupt mask register (IMR) : It stores the interrupt level which have to be masked by
storing the masking bits of the interrupt level.
8259 interrupt controller
Priority resolver :
It examines all the three registers and set the priority of interrupts and
according to the priority of the interrupts, interrupt with highest priority is set
in ISR register. Also, it reset the interrupt level which is already been serviced in
IRR.
Cascade buffer :
To increase the Interrupt handling capability, cascading is done for more
number of pins by using cascade buffer. So, during increment of interrupt
capability, CSA lines are used to control multiple interrupt structure.
SP/EN (Slave program/Enable buffer) pin is when set to high, works in master
mode else in slave mode. In Non Buffered mode, SP/EN pin is used to specify
whether 8259 work as master or slave and in Buffered mode, SP/EN pin is used
as an output to enable data bus.
8259 Interrupt Controller
ICW2 command :
The control word is recognized as ICW2 when A0= 1.
It stores the information regarding the interrupt vector address.
In the 8085 based system, the A15 to A8 bits of control word is used for interrupt vector
addresses.
In the 8086 based system, T6 to T3 bits are inserted instead of A15 to A8 and A10 to A8 are
used for selecting interrupt level, i.e. 000 for IR0 and 111 for IR7.
8259 Operational command word
Operational command word 1
It is used to set and reset the mask bits in IMR(interrupt mask register). M7 –
M0 describes 8 mask bits
Direct Memory Access (DMA)
The unit communicates with the CPU through data bus and control lines.
Through the use of the address bus and allowing the DMA and RS register to select
inputs, the register within the DMA is chosen by the CPU.
When BG (bus grant) input is 1, the CPU has relinquished the buses and DMA can
communicate directly with the memory.
Direct Memory Access (DMA)
DMA registers
One wire carries a varying voltage that represents the signal, while the
other wire is
connected to a reference voltage, usually ground.
RS-422A
This standard fixes problems in RS-232C such as a short transmission distance and a
slow transmission speed.It is also called "EIA-422A".The purpose and timing of the
signal lines are defined, but the connectors are not.Many compatible products
primarily adopt D-sub 25-pin and D-sub 9-pin connectors.
RS-485
This standard fixes the problem of few connected devices in RS-422A.It is also called
"EIA-485".RS-485 is forward compatible standard with RS-422A.The purpose and
timing of the signal lines are defined, but the connectors are not.Many compatible
products primarily adopt D-sub 25-pin and D-sub 9-pin connectors
In RS-232C, the connectors to use and the signal assignments have been defined
and are standardized. The figure to the right describes the D-sub 9-pin signal
assignments and signal lines.
Signal ground
5 SG Signal Ground
or common
return
6 DSR Data Set Ready Data set ready
Maintenance ground
CASE FG Frame Ground
or earth
RS 232 Connection method
In RS-232C, the connectors and signal assignments have been standardized, so many
standard-compliant cables are available commercially. However, equipment comes in the
following types, and depending on the equipment that will be connected, a straight
cable or a crossover cable is required.
Equipment type
DCE
Data communication equipment.This term indicates equipment that passively operates
such as modems, printers, and plotters.
DTE
Data terminal equipment.This term indicates equipment that actively operates such as
computers.
Full-duplex communication
A method where send and receive both have their own transmission line so data can
be simultaneously sent and received.
Half-duplex communication
A method where communication is performed using one transmission line while
switching between send and receive. For this reason, simultaneous communication
cannot be performed.
Crossover cable connection
Full-duplex communication A method where send and receive both have their
own transmission line so data can be simultaneously sent and received. Half-
duplex communication A method where communication is performed using one
transmission line while switching between send and receive. For this reason,
simultaneous communication cannot be performed
Serial Data transfer schemes
Serial communication transmits data one bit at a time, sequentially, over a single
communication line to a receiver.
Serial is also a most popular communication protocol that is used by many
devices for
instrumentation.
This method is used when data transfer rates are very low or the data must be
transferred over long distances and also where the cost of cable and synchronization
difficulties makes parallel communication impractical. Serial communication is popular
because most
Synchronous data transmission
The synchronous signaling methods use two different signals. A pulse on one signal
line indicates when another bit of information is ready on the other signal line.
The asynchronous signaling methods use only one signal. The receiver uses
transitions on that signal to figure out the transmitter bit rate (known as auto
baud) and timing.
A pulse from the local clock indicates when another bit is ready. That means
synchronous transmissions use an external clock, while asynchronous
transmissions use special signals along the transmission medium.
CPU
Bus Serial
4 I/O Ports Port
OSC Control
P0 P1 P2 P3 TxD RxD
Address/Data
Comparison of the 8051 Family Members
Vcc ( pin 40 ):
Vcc provides supply voltage to the chip.
The voltage source is +5V.
GND ( pin 20 ): ground
XTAL1 and XTAL2 ( pins 19,18 ):
These 2 pins provide external clock.
Way 1 : using a quartz crystal oscillator
Way 2 : using a TTL oscillator
Example 4-1 shows the relationship between XTAL
and the machine cycle.
Pins of 8051 ( 2/4 )
It is a power-on reset.
externally.
/PSEN & ALE are used for external ROM.
The ALE pin is used for de-multiplexing the address and data by
Using a quartz crystal oscillXatToAr L1
We can observe the frequency on the XTAL2 pin.
Figure 4-2 (b). XTAL Connection to an External Clock
Source
N XTAL2
C
Using a TTL oscillator
EXTERNAL
XTAL2 is unconnected. OSCILLATOR
SIGNAL XTAL1
GN
D
RESET Value of Some 8051 Registers:
10 uF 31
EA/VPP
30 pF X1
19
11.0592 MHz
8.2 K
X2
18
30 pF
9 RST
Figure 4-3 (b). Power-On RESET with Debounce
Vc
c
3
1 EA/VPP
X1
10 30
uF pF
X2
RST
9
8.2
K
Pins of I/O Port
R0
DPTR DPH DPL
R1
R2 PC PC
R3
R5
R6
R7
Solution:
Edsim51 emulator
diagram
KitCON-515 schematic
Timers
8051 has two 16-bit on-chip timers that can
be used for timing durations or for counting
external events
The high byte for timer 1 (TH1) is at
address 8DH while the low byte (TL1) is at
8BH
The high byte for timer 0 (TH0) is at 8CH
while the low byte (TL0) is at 8AH.
Timer Mode Register (TMOD) is at
address 88H
Timer Mode
Register
Bit 7: Gate bit; when set, timer only runs while \INT
high. (T0)
Bit 6: Counter/timer select bit; when set timer is an event
counter when cleared timer is an interval timer (T0)
Bit 5: Mode bit 1 (T0)
Bit 4: Mode bit 0 (T0)
Bit 3: Gate bit; when set, timer only runs while \INT
high. (T1)
Bit 2: Counter/timer select bit; when set timer is an event
counter when cleared timer is an interval timer (T1)
Bit 1: Mode bit 1 (T1)
Bit 0: Mode bit 0 (T1)
Timer Modes
M1-M0: 00 (Mode 0) – 13-bit mode
(not commonly used)
M1-M0: 01 (Mode 1) - 16-bit timer
mode
M1-M0: 10 (Mode 2) - 8-bit auto-
reload mode
M1-M0: 11 (Mode 3) – Split timer
mode
8051 Interrupt Vector Table
The Stack and Stack
Pointer
The Stack Pointer, like all registers except DPTR and PC, may hold an 8-bit (1-
byte) value.
The Stack Pointer is used to indicate where the next value to be removed from
the stack should be taken from.
When you push a value onto the stack, the 8051 first increments the value of SP
and
then stores the value at the resulting memory location.
When you pop a value off the stack, the 8051 returns the value from the memory
location indicated by SP, and then decrements the value of SP.
This order of operation is important. When the 8051 is initialized SP will be
initialized to 07h. If you immediately push a value onto the stack, the value will be
stored in Internal RAM address 08h. This makes sense taking into account what was
mentioned two paragraphs above: First the 8051 will increment the value of SP
(from 07h to 08h) and then will store the pushed value at that memory address
(08h).
SP is modified directly by the 8051 by six instructions: PUSH, POP, ACALL,
LCALL,
RET, and RETI. It is also used intrinsically whenever an interrupt is triggered
DEPT & SEM : EEE & III/II
SEM
SUBJECT NAME: DIGITAL
COMPUTE PLATFORMS
UNIT : IV
PREPARED
:
BY
C.MUNIKANTH
A
OUTLINE – UNIT-1
Introduction to the TMS320LF2407 DSP Controller
Introduction to Interrupts
interrupt Hierarchy
Interrupt Control Registers.
C2xx DSP CPU
Instruction Set:
Memory
Memory Addressing Modes
Assembly Programming Using the C2xx DSP
Instruction set. COURSE: DCN UNIT: 1 Pg.
DSP CONTROLLER ARCHITECTURE
A TMS 320 C 6713 DSP operating at 225 MHz.
• 16 Mbytes of synchronous DRAM
• 512 Kbytes of non-volatile Flash memory
• (256 Kbytes usable in default conguration)
• 4 user accessible LEDs and DIP switches
• Software board conguration through
•registers implemented in CPLD ACOE 343 -
Embedded Real-Time Processor Systems
Differences between DSP and Microcontroller
TMS320LF2407 DSP Controller functional diagram
TMS320LF2407 DSP Controller functional diagram 1/2
TMS320LF2407 DSP Controller functional diagram 2/2
TMS320LF2407 DSP Controller
The 240xA offers increased processing performance (40 MIPS) and a higher
level of
peripheral integration.
All 240xA devices offer at least one event manager module which has been
TMS320LF2407 DSP Controller
The LF2407A combines the high-performance CPU core with a set of peripherals acting
as the “heavy artillery” to meet interfacing requirements for the most demanding of
problems in terms of digital signal processing, communications and general purpose I/O
operations.
the peripherals commonly employed are the event managers and the ADC.
TMS320LF2407 DSP Controller
The Serial Communications Interface. The SCI implements typical asynchronous serial
communications (UART). Typical applications of the SCI include communications with
other controllers, or a PC. The designated lines for reception (RX) and transmission (TX)
are not level-shifted on the DSP board (i.e., they operate at 0-3.3V).
TMS320LF2407 DSP Controller
• The ’F24x incorporates one 16K/8K × 16-bit flash EEPROM module in program space.
• This type of memory expands the capabilities of the ’F24x in the areas of prototyping,
early field testing, and single-chip applications.
•Unlike most discrete flash memory, the ’F24x flash does not require a dedicated state
machine because the algorithms for programming and erasing the flash are executed by
the DSP core. This enables several advantages, including reduced chip size and
sophisticated adaptive algorithms..
• Other key features of the flash include zero-wait-state access rate and single 5-V
power
supply. The following four algorithms are required for flash operations:
• clear, erase, flash-write, and program.
ROM Memory MAP
Memory maps
Memory map
PERIPHERAL MEMORY MAP
External Memory Interface Module
•In addition to full, on-chip memory support, some of the ’C24x devices provide
access to external memory by way of the External Memory Interface Module.
•This interface provides 16 external address lines, 16 external data lines, and
relevant control signals to select data, program, and I/O spaces. An on-chip wait-
state generator allows interfacing with slower off-chip memory and peripherals.
Central Processing Unit
A 32-bit input data-scaling shifter (input shifter) aligns the 16-bit value from memory to
the 32- bit central arithmetic logic unit (CALU).
This data alignment is necessary for data-scaling arithmetic, as well as aligning masks for
logical operations.
The input shifter operates as part of the data path between program or data space and
the CALU; and therefore, requires no cycle overhead.
Input. Bits 15 through 0 of the input shifter accept a 16-bit input from either of two
The data read bus (DRDB). This input is a value from a data memory location referenced
in an instruction operand.
The program read bus (PRDB). This input is a constant value given as an instruction
operand. Output. After a value has been accepted into bits 15 through 0, the input shifter
aligns the16-bit value to the 32-bit bus of the CALU
The shifter shifts the value left 0 to 16 bits and then sends the 32-bit result to the CALU.
Multiplication Section
The ’C24x uses a 16-bit × 16-bit hardware multiplier that can produce a signed or
unsigned 32-bit product in a single machine cycle.
The multiplication section consists of:
The 16-bit temporary register (TREG), which holds one of the multiplicands
The multiplier, which multiplies the TREG value by a second value from data memory
or program memory .
The 32-bit product register (PREG), which receives the result of the multiplication
The product shifter, which scales the PREG value before passing it to the CALU
Multiplier
The 16-bit × 16-bit hardware multiplier can produce a signed or unsigned 32-bit product
in a single machine cycle.
The two numbers being multiplied are treated as 2s-complement numbers, except
during unsigned multiplication (MPYU instruction).
Descriptions of the inputs to, and output of, the multiplier
The hardware interrupts INT1 – INT6, along with NMI, TRAP, and RS, provide a flexible
interrrupt scheme.
The software interrupts offer flexibility to access interrupt vectors using software
instructions.
Since most of the ’C24x DSPs come with multiple peripherals, the core interrupts
(INT1–
IN6) are expanded using additional system or peripheral interrupt logic.
Although the core interrupts are the same, the peripheral interrupt structure varies
slightly among ’C240 and ’C24x class of DSP controllers.
The 2407A is able to “sense” numerous interrupt sources, mainly related to its
peripherals.
The Peripheral Interrupt Expansion Controller (PIE)
The 2407A acknowledges interrupts in two levels. The core itself provides six maskable
interrupts (INT1-6). Technically, each of those interrupts may correspond to one specific
source. When programming interrupts for a PC, we know that there is a one-to-one
mapping from a peripheral interrupt source to a core interrupt in the CPU.
To overcome the problem of having a great number of hardware interrupts (as opposed
to the six available maskable core interrupts) to be served by the CPU, these interrupts
are organized in groups or levels, each one corresponding to one of the six core maskable
interrupts (INT1-6). This is actually where the peripheral interrupt expansion controller
(PIE) kicks-in. The PIE “intercepts” interrupt signals from the various peripherals and
consequently triggers the appropriate core interrupt.
Addressing Modes
Ezxample.
RPT #99 ;Execute the instruction that follows RPT ;100 times.
ADD #16384,2 ;Shift the value 16384 left by two bits ;and add the result to the
accumulator.
Direct Addressing Mode
In the direct addressing mode, data memory is addressed in blocks of 128 words called
data pages. The entire 64K of data memory consists of 512 data pages labeled 0
through 511.
The current data page is determined by the value in the 9-bit data page pointer (DP) in
status register ST0.
For example, if the DP value is 0 0000 00002, the current data page is If the DP value is
0 0000 00102, the current data page is 2.
Indirect Addressing Mode
Eight auxiliary registers (AR0–AR7) provide flexible and powerful indirect addressing. Any
location in the 64K data memory space can be accessed using a 16-bit address contained
in an auxiliary register.
Indirect Addressing Options The ’C24x provides four types of indirect addressing options:
No increment or decrement. The instruction uses the content of the current auxiliary
register as the data memory address but neither increments nor decrements the content
of the current auxiliary register.
Increment or decrement by 1. The instruction uses the content of the current auxiliary
register as the data memory address and then increments or decrements the content of
the current auxiliary register by on.
The addition and subtraction process is accomplished with the carry propagation
reversed for fast Fourier transforms (FFTs).
Assembly Language Instructions
Instruction Set Summary
This section provides six tables (Table 7–1 to Table 7–6) that summarize the instruction
set according to the following functional headings:
Accumulator, arithmetic, and logic instructions Auxiliary register and data page pointer
instructions (see Table 7–2 on page 7-7)
TREG, PREG, and multiply instructions (see Table 7–3 on page 7-8)
Branch instructions (see Table 7–4 on page 7-9)
Control instructions (see Table 7–5 on page 7-10)
I/O and memory operations (see Table 7–6 on page 7-11)
definitions of the symbols used in the six summary tables:
ACC The accumulator AR The auxiliary register ARX A 3-bit value used in the LAR and
SAR instructions to designate which auxiliary register will be loaded (LAR) or have its
contents stored (SAR)
BITX A 4-bit value (called the bit code) that determines which bit of a designated
data
memory value will be tested by the BIT instruction.
CM A 2-bit value. The CMPR instruction performs a comparison specified by the value of
CM:
If CM = 00, test whether current AR = AR0
If CM = 01, test whether current AR < AR0
If CM = 10, test whether current AR > AR0
Definitions of the symbols used in the six summary tables:
IAAA AAAA (One I followed by seven As)
The I at the left represents a bit that reflects whether direct addressing (I = 0) or
indirect addressing (I = 1) is being used.
When direct addressing is used, the seven As are the seven least significant bits (LSBs)
of a data memory address.
For indirect addressing, the seven As are bits that control auxiliary register
manipulation,
IIII IIII (Eight Is) An 8-bit constant used in short immediate addressing
I IIII IIII (Nine Is) A 9-bit constant used in short immediate addressing for
the LDP
instruction
I IIII IIII IIII (Thirteen Is) A 13-bit constant used in short immediate addressing for the
MPY instruction.
I NTR# A 5-bit value representing a number from 0 to 31.
The INTR instruction uses this number to change program control to one of the 32
interrupt vector addresses.
PM A 2-bit value copied into the PM bits of status register ST1 by the SPM instruction
SHF A 3-bit left-shift value
SHFT A 4-bit left-shift value
TP A 2-bit value used by the conditional execution instructions to represent four
conditions
BIO pin low TP = 00
DIGITAL RESOURCES
Lecture Notes –
https://classroom.google.com/c/NDc1MzQ3NDk1MDM5/m/NDkzMzE5NzI0OTEz/details
Vidéo Lectures –
watch?v=GapjjO_8Kuk
UNIT : V
PREPARED
:C
BY
MUNIKANTHA
OUTLINE
Introduction to Field Programmable Gate Arrays
CPLD Vs FPGA
Types of FPGA
Configurable logic
Blocks (CLB)
PLDs are the integrated circuits. They contain an array of AND gates & another array of
OR gates. There are three kinds of PLDs based on the type of arrays, which has
programmable feature.
The process of entering the information into these devices is known as programming.
Basically, users can program these devices or ICs electrically in order to implement the
Boolean functions based on the requirement. Here, the term programming refers to
hardware programming but not software programming.
Field Programmable Gate Arrays
Field Programmable Gate Arrays or FPGAs in short are pre-fabricated Silicon devices
that consists of a matrix of reconfigurable logic circuitry and programmable
interconnects arranged in a two-dimensional array.
The programmable Logic Cells can be configured to perform any digital function and
the programmable interconnects (or switches) provide the connections among
different logic cells.
Using an FPGA, you can implement any custom design by specifying the logic or
function of each logic block and setting the connection of each programmable switch.
Since this process of designing a custom circuit is done in the field rather than in a fab,
the device is known as “Field Programmable”.
An FPGA consists of three basic components. They are:
Programmable Logic Cells (or Logic Blocks) – responsible for implementing the core logic
functions.
IO Blocks – which are connected to the Logic Blocks through the routing and help to make
external connections
PLA (Programmable logic array)
PAL (Programmable array logic)
FPGA
FPGA
CPLD versus FPGA
FPGAs and CPLDs are two of the well-known types of digital logic chips. When it comes to
the internal architecture, the two chips are obviously different.
FPGA is short for Field-Programmable Gate Array, is a type of a programmable logic chip.
It is great chip as it can be programmed to do almost any kind of digital function. FPGA’s
architecture allows the chip to have a very high logic capacity. It is used in designs that
require a high gate count and their delays are quite unpredictable because of
its architecture.
The FPGA is considered as ‘fine-grain’ because it contains a lot of tiny logic blocks that
could reach up to 100,000. It is with flip-flops, combination logic, and On the other hand,
CPLD (Complex Programmable Logic Device) is designed by using EEPROM (electrically
erasable programmable read-only memory) . It is more suitable in small gate count
designs. Since it is a less complex architecture, the delays are much predictable and it is
non-volatile.
CPLD versus FPGA
CPLD is often used for simple logic applications. It contains only a few blocks of logic and
reaches up to 100. Having said that, CPLDs are considered as ‘coarse-grain’ type of
devices. CPLDs are cheap and it also offers a much faster input to output duration
because of its simpler, ‘coarse grain’ architecture.
FPGAs are cheaper per gate but expensive when it comes to package.
Working with FPGAs requires special procedures as it is RAM based. To program the
device, you have to first describe the ‘logic function’ with the use of computer, either by
drawing a schematic or simply describing the function on a text file.
Compilation of the ‘logic function’ usually requires a software. It creates a binary file to
be downloaded into the FPGA and then the chip will behave just what you have
instructed in the ‘logic function’.
CPLD versus FPGA
1. FPGA contains up to 100,000 of tiny logic blocks while CPLD contains only a few blocks
of logic that reaches up to a few thousands.
2. In terms of architecture, FPGAs are considered as ‘fine-grain’ devices while CPLDs are
‘coarse-grain’.
3. FPGAs are great for more complex applications while CPLDs are better for simpler
ones.
4. FPGAs are made up of tiny logic blocks while CPLDs are made of larger blocks.
6. Normally, FPGAs are more expensive while CPLDs are much cheaper.
These two types of FPGAs differ in the implementation of the logic cell and the
mechanism used to make connections in the device.
The dominant type of FPGA is SRAM-based and can be reprogrammed as often. In fact, an
SRAM FPGA is reprogrammed every time it’s powered up, because the FPGA is really a
fancy memory chip. That’s why you need a serial PROM or system memory with every
SRAM FPGA
SRAM
A typical 6 transistor SRAM Cell to store 1 bit is shown in the following image.
SRAM is designed using transistors and the term static means that the value
loaded on a basic SRAM Memory Cell will remain the same until deliberately
changed or when the power is removed.
Types of FPGA
Property OTP FPGA MTP FPGA
Speed smaller larger
Power lower higher
Consumption
Working Radiation hardened NO radiation
Environment hardened
(Radiation)
AMD announced its acquisition of Xilinx in October 2020 and the deal was completed
on February 14, 2022 through an all-stock transaction worth an estimated $50 billion.
Before 2010, Xilinx offered two main FPGA families: the high-
performance Virtex series and the high-volume Spartan series, with a cheaper
EasyPath option for ramping to volume production.
The company also provides two CPLD lines: the CoolRunner and the 9500 series. Each
model series has been released in multiple generations since its launch. With the
introduction of its 28 nm FPGAs in June 2010, Xilinx replaced the high-volume Spartan
family with the Kintex family and the low-cost Artix family.
XC3000 series
Complete line of four related Field Programmable Gate Array product families - XC3000A,
XC3000L, XC3100A, XC3100L
•Ideal for a wide range of custom VLSI design tasks - Replaces TTL, MSI, and other
PLD logic - Integrates complete sub-systems into a single package - Avoids the NRE, time
delay, and risk of conventional masked gate arrays
A configurable logic block (CLB) is the basic repeating logic resource on an FPGA. When
linked together by routing resources, the components in CLBs execute complex logic
functions, implement memory functions, and synchronize code on the FPGA.
CLBs contain smaller components, including flip-flops, look-up tables (LUTs), and
multiplexers
Flip-Flop—A circuit capable of two stable states that represents a single bit. A flip-flop is
the smallest storage resource on the FPGA. Each flip-flop in a CLB is a binary register
used to save logic states between clock cycles on an FPGA circuit.
Look-up Table (LUT)—A collection of gates hardwired on the FPGA. An LUT stores a
predefined list of outputs for every combination of inputs. LUTs provide a fast way to
retrieve the output of a logic operation because possible results are stored and then
referenced rather than calculated. The LUTs in a CLB can also implement FIFOs and
memory items in LabVIEW.
Multiplexer—A circuit that selects between two or more inputs and then returns the
selected input.
Configurable logic Blocks (CLB
To run on an FPGA target, LabVIEW implements much of the code using flip-flops,
LUTs, and multiplexers.
Input / Output Block (IOB)
The input/output block (IOB) is used for communication between the problem
program and the system.
It provides the addresses of other control blocks, and maintains information about
the channel program, such as the type of chaining and the progress of I/O operations.
First define the IOB and specify its address as the only parameter of the EXCP or
EXCPVR macro instruction.
For direct access, teleprocessing, and graphic devices, 8 additional bytes must be
provided. Use the system mapping macro IEZIOB, which expands into a DSECT, to
help in constructing an IOB.
Input / Output Block (IOB)
A one-bit in position 6 (IOBUNREL) indicates that the channel program is not a related
request; that is, the channel program is not related to any other channel program. See
bits 2 and 3 of IOBFLAG2 below.
If you intend to issue an EXCP or XDAP macro with a BSAM, QSAM, or BPAM DCB, you
should turn on bit 7 (IOBSPSVC) to prevent access-method appendages from
processing the I/O request.
Input / Output Block (IOB)
IOBFLAG2 (1 byte)
If you set bit 6 in the IOBFLAG1 field to zero, bits 2 and 3 (IOBRRT3 and IOBRRT2) in this
field must then be set to one of the following:
00, if any channel program or appendage associated with a related request might modify
this IOB or channel program.
01, if the conditions requiring a 00 setting do not apply, but the CHE or ABE appendage
might retry this channel program if it completes normally or with the unit-exception or
wrong-length-record bits on in the CSW.
10 in all other cases.
The combinations of bits 2 and 3 represent related requests,known as type 1 (00), type 2
(01), and type 3 (10). The type you use determines how much the system can overlap the
processing of related requests. Type 3 allows the greatest overlap, normally making it
possible to quickly reuse a device after a channel-end interruption. (Related requests that
were executed on a pre-MVS system are executed as type-1 requests if not modified.)
Programmable Interconnect Point (PIP)
Field Programmable Gate Arrays (FPGA) are very interesting integrated circuits. The
possibility of completing different tasks by just reprogramming the FPGA made us think at
first view it was a kind of microcontroller. We were far from the reality. FPGAs are
reprogrammable logic/memory circuits and can be faster than any microcontroller. The
main difference is that a microcontroller has a program written in memory, and a FPGA
only has programmed connections/cells, so the data follows a continuous way through
programmed logic and memory cells, instead of being processed by only one ALU.
Programmable Interconnect Points are vital to any FPGA, they allow us to link the output
of a cell, or an input pad of the FPGA to any other cell/Pad in the circuit by making a
“path” for the data through the FPGA. Every way is fixed during the programming by
connecting metal lines with PIPs. These PIPs, well named, are programmable to permit us
to build any path we want.
Programmable Interconnect Point (PIP)
To describe digital circuits, textual language is used that is specifically intended to clearly
and concisely capture the defining features of digital design.
Such languages are called hardware description languages (HDLs).
The most popular hardware description languages are Verilog and VHDL. They are widely
used in conjunction with FPGAs, which are digital devices that are specifically designed to
facilitate the creation of customized digital circuits.
Hardware description languages allow you to describe a circuit using words and symbols,
and then development software can convert that textual description into configuration
data that is loaded into the FPGA in order to implement the desired functionality.
entity Circuit_1 is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
out1 : out STD_LOGIC);
end Circuit_1;
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY not1 IS
PORT( a : IN STD_LOGIC; b : OUT STD_LOGIC; );
END not1;
ARCHITECTURE behavioral OF not1 IS
BEGIN b <= NOT a;
END behavioral;
entity HALF_ADDER is
port (A, B: in BIT;
SUM, CARRY: out BIT);
end HALF_ADDER;
overview of Spartan 3E and Virtex II pro FPGA boards
The Spartan-3E family of Field-Programmable Gate Arrays (FPGAs) is specifically designed
to meet the needs of high volume, cost-sensitive consumer electronic applications.
The five-member family offers densities ranging from 100,000 to 1.6 million system gates.
The Spartan-3E family builds on the success of the earlier Spartan-3 family by increasing
the amount of logic per I/O, significantly reducing the cost per logic cell. New features
improve system performance and reduce the cost of configuration.
Because of their exceptionally low cost, Spartan-3E FPGAs are ideally suited to a wide
range of consumer electronics applications, including broadband access, home
networking, display/projection, and digital television equipment.
The Spartan-3E family is a superior alternative to mask programmed ASICs. FPGAs avoid
the high initial cost, the lengthy development cycles, and the inherent inflexibility of
conventional ASICs. Also, FPGA programmability permits design upgrades in the field with
no hardware replacement necessary, an impossibility with ASICs.
overview of Spartan 3E and Virtex II pro FPGA boards
Features of Spartan 3E
Very low cost
high-performance logic solution for high-volume consumer-oriented applications
• Proven advanced 90-nanometer process technology
• Multi-voltage, multi-standard SelectIO™ interface pins
- Up to 376 I/O pins or 156 differential signal pairs
- LVCMOS, LVTTL, HSTL, and SSTL single-ended signal standards
- 3.3V, 2.5V, 1.8V, 1.5V, and 1.2V signaling
622+ Mb/s data transfer rate per I/O
- True LVDS, RSDS, mini-LVDS, differential HSTL/SSTL differential I/O
- Enhanced Double Data Rate (DDR) support
- DDR SDRAM support up to 333 Mb/s
-Eight global clocks plus eight additional clocks per each half of device, plus abundant
low-skew routing
- • Configuration interface to industry-standard PROMs
- - Low-cost, space
--saving SPI serial Flash PROM
-- x8 or x8/x16 parallel NOR Flash PROM
-Low-cost Xilinx Platform Flash with JTAG
-Fully compliant 32-/64-bit 33 MHz PCI support (66 MHz in some devices)
-• Low-cost QFP and BGA packaging options
- - Common footprints support easy density migration
-- Pb-free packaging options
Virtex II pro FPGA boards
The Virtex-II Pro (V2-Pro) development system can be used at virtually any level of the
engineering curricula, from introductory courses through advanced research projects.
Based on the Virtex-II Pro FPGA, the board can function as a digital design trainer, a
microprocessor development system, or a host for embedded processor cores and
complex digital systems.
Switches 4
Push-buttons 5
LEDs 4 LEDs
User LED 4
User RGB LED 4
Electrical Power 4.5-5.5V
Logic Level 3.3V
DIGITAL RESOURCES