AT94K05AL ATMEL Corporation, AT94K05AL Datasheet - Page 107

no-image

AT94K05AL

Manufacturer Part Number
AT94K05AL
Description
Fpslic Devices Combine 5K Gates of Atmel's Patented AT40K Fpga Architecture, a 20 Mips Avr 8-bit Risc Microprocessor Core, Numerous Fixed Microcontroller Peripheries And up to 36K Bytes of Program And Data SRAM.
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AT94K05AL-25AJC
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
AT94K05AL-25AJI
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
AT94K05AL-25AQC
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
AT94K05AL-25AQI
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
AT94K05AL-25AQU
Manufacturer:
Atmel
Quantity:
10 000
8-bit Multiplication
Example 1 –
Basic Usage
Example 2 –
Special Cases
Rev. 1138F–FPSLI–06/02
Doing an 8-bit multiply using the hardware multiplier is simple: just load the operands into two
registers (or only one for square multiply) and execute one of the multiply instructions. The
result will be placed in register pair R1:R0. However, note that only the MUL instruction does
not have register usage restrictions. Figure 59 shows the valid (operand) register usage for
each of the multiply instructions.
The first example shows an assembly code that reads the port B input value and multiplies this
value with a constant (5) before storing the result in register pair R17:R16.
Note the use of the MOVW instruction. This example is valid for all of the multiply instructions.
Figure 59. Valid Register Usage
This example shows some special cases of the MUL instruction that are valid.
Even though the operand is put in the result register pair R1:R0, the operation gives the cor-
rect result since R1 and R0 are fetched in the first clock cycle and the result is stored back in
the second clock cycle.
in
ldi
mul
movw r17:r16,r1:r0; Move the result to the r17:r16
lds
lds
mul
lds
mul
r16,PINB
r17,5
r16,r17
r0,variableA; Load r0 with SRAM variable A
r1,variableB; Load r1 with SRAM variable B
r1,r0
r0,variableA; Load r0 with SRAM variable A
r0,r0
MUL
R10
R11
R12
R13
R14
R15
R16
R17
R18
R19
R20
R21
R22
R23
R24
R25
R26
R27
R28
R29
R30
R31
R0
R1
R2
R3
R4
R5
R6
R7
R8
R9
; r1:r0 = variable A * variable B
; r0:r0 = square(variable A)
; Read pin values
; Load 5 into r17
; r1:r0 = r17 * r16
; register pair
MULS
R16
R17
R18
R19
R20
R21
R22
R23
R24
R25
R26
R27
R28
R29
R30
R31
AT94K Series FPSLIC
FMULSU
MULSU
FMULS
FMUL
R16
R17
R18
R19
R20
R21
R22
R23
107

Related parts for AT94K05AL