C165UTAH
Architectural Overview
Data Sheet
31
2001-02-23
completed per machine cycle, except for multiply and divide. An advanced Booth
algorithm has been incorporated to allow four bits to be multiplied and two bits to be
divided per machine cycle. Thus, these operations use two coupled 16-bit registers, MDL
and MDH, and require four and nine machine cycles, respectively, to perform a 16-bit by
16-bit (or 32-bit by 16-bit) calculation plus one machine cycle to setup and adjust the
operands and the result. Even these longer multiply and divide instructions can be
interrupted during their execution to allow for very fast interrupt response. Instructions
have also been provided to allow byte packing in memory while providing sign extension
of bytes for word wide arithmetic operations. The internal bus structure also allows
transfers of bytes or words to or from peripherals based on the peripheral requirements.
A set of consistent flags is automatically updated in the PSW after each arithmetic,
logical, shift, or movement operation. These flags allow branching on specific conditions.
Support for both signed and unsigned arithmetic is provided through user-specifiable
branch tests. These flags are also preserved automatically by the CPU upon entry into
an interrupt or trap routine.
All targets for branch calculations are also computed in the central ALU.
A 16-bit barrel shifter provides multiple bit shifts in a single cycle. Rotates and arithmetic
shifts are also supported.
Extended Bit Processing and Peripheral Control
A large number of instructions has been dedicated to bit processing. These instructions
provide efficient control and testing of peripherals while enhancing data manipulation.
Unlike other microcontrollers, these instructions provide direct access to two operands
in the bit-addressable space without requiring to move them into temporary flags.
The same logical instructions available for words and bytes are also supported for bits.
This allows the user to compare and modify a control bit for a peripheral in one
instruction. Multiple bit shift instructions have been included to avoid long instruction
streams of single bit shift operations. These are also performed in a single machine
cycle.
In addition, bit field instructions have been provided, which allow the modification of
multiple bits from one operand in a single instruction.
High Performance Branch-, Call-, and Loop Processing
Due to the high percentage of branching in controller applications, branch instructions
have been optimized to require one extra machine cycle only when a branch is taken.
This is implemented by precalculating the target address while decoding the instruction.
To decrease loop execution overhead, three enhancements have been provided:
he first solution provides single cycle branch execution after the first iteration of a loop.
Thus, only one machine cycle is lost during the execution of the entire loop. In loops
which fall through upon completion, no machine cycles are lost when exiting the loop.