Inc. Portable Generator User Manual
Math 93
Xilinx Blocks
Block Parameters Dialog Box
The block parameters dialog box can be invoked by double-clicking the icon in your
Simulink model.
Figure 3-64: Shift block parameters dialog box
Parameters specific to the Shift block are:
• Shift Direction:specifies adirection, Left or Right. The Right shift moves the
input toward the least significant bit within its container, with appropriate sign
extension. Bits shifted out of the container are discarded. The Left shift moves the
input toward the most significantbit withinits container withzeropadding ofthe
least significant bits. Bits shifted out of the container are discarded.
• Number of Bits: specifies how many bits areshifted. Ifthe number is negative,
direction selected with Shift direction is reversed.
Other parameters usedby thisblock areexplained in the CommonParameters section
of the previous chapter.
The Shift block does not use a Xilinx LogiCORE.
SineCosine
The Xilinx Sine Cosine block computes sin(x) and/or cos(x).
It stores areference sinusoid ina read-only memory (ROM),
whose depth is defined by the width of the block’s single
input port. An N-bit input address resultsin a logicalROM
containing 2
N
equally spaced samples of one period (the
implementation may actually store only a fraction of one
full period to reduce memory size). The input signal must be an unsigned integer.
The block canproducea sineor cosine (orits negative) at oneoutput port, or bothsine
and cosine (or their negatives) at two output ports, depending on customization
parameters. Stepping through the memory produces sampled sinusoids on the
block’s output port(s), with output frequency determined by the address increment.
Although the error is quite small for practical choices of output width, the
implementation is unbalanced; that is, values are stored in the memory as two’s
complementnumbers havingexactlyone signbit. Consequently,samplevalues ofthe