COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Help! Signed Number Representation in Xilinx Testbench Waveform

• Email
• Follow

```Hi,

I am using Xilinx ISE Testbench Waveform to simulate my VHDL code and
there is something that confused me:

-256 is equal to '111100000000' in two's complement
notation.'111100000000' is equal to 3840 if you interpret it as having
no sign bit.

In the testbench waveform I have several options to enter the input.
Some of them:
Decimal(Signed)
Decimal(Unsigned)
Binary

You can enter a number in one of these ways and you can also convert
one to the other. Thus, if I enter -256 while in the Decimal(Signed)
option, I expect it to be '111100000000' in the binary option. However,
I get '100100000000' or in Decimal(Unsigned), 2304.

Does Xilinx ISE Testbench Waveform use a representation other than 2's
complement? If I want to enter a negative number and want to process it
as a signed number in my code, how should I enter it in Xilinx ISE
Testbench Waveform?

Thanks in advance for any help

E.

```
 0
Reply emeltasyurek (7) 1/18/2006 6:54:19 PM

See related articles to this posting

```On Wed, 18 Jan 2006, Emel wrote:

"I am using Xilinx ISE Testbench Waveform to simulate my VHDL code and
there is something that confused me:

-256 is equal to '111100000000' in two's complement
notation.'111100000000' is equal to 3840 if you interpret it as having
no sign bit.

In the testbench waveform I have several options to enter the input.
Some of them:
Decimal(Signed)
Decimal(Unsigned)
Binary

You can enter a number in one of these ways and you can also convert
one to the other. Thus, if I enter -256 while in the Decimal(Signed)
option, I expect it to be '111100000000' in the binary option. However,
I get '100100000000' or in Decimal(Unsigned), 2304.

Does Xilinx ISE Testbench Waveform use a representation other than 2's
complement?"

You said that if you enter -256 that the binary representation is reported
as 100100000000 which is +256 (100000000) in two's complement binary but
with three extra more significant bits (100). So one obvious possibility
is that the single most significant bit is a flag, which when 1 denotes
that the number is the negative of the positive two's complement number
made up from the other bits, and when 0 is a positive number.

This notation is called one's complement. Positive numbers are represented
identically in one's complement and two's complement, only their negative
representations differ.

"If I want to enter a negative number and want to process it
as a signed number in my code, how should I enter it in Xilinx ISE
Testbench Waveform?"

It seems that you are more comfortable with decimal. If you want to think
in terms of binary, simply mask out (what in unsigned arithmetic would be)
the most significant bit to think about the magnitude and pay attention
to only the most significant bit when you want to think about the sign.

N.B. Positive zero is not represented the same as negative zero in one's
complement notation.

Regards,
Colin Paul Gloster
```
 0

```On Thu, 19 Jan 2006 11:46:24 +0100, Colin Paul Gloster
<Colin_Paul_Gloster@ACM.org> wrote:

>On Wed, 18 Jan 2006, Emel wrote:

>You said that if you enter -256 that the binary representation is reported
>as 100100000000 which is +256 (100000000) in two's complement binary but
>with three extra more significant bits (100). So one obvious possibility
>is that the single most significant bit is a flag, which when 1 denotes
>that the number is the negative of the positive two's complement number
>made up from the other bits, and when 0 is a positive number.
>
>This notation is called one's complement. Positive numbers are represented
>identically in one's complement and two's complement, only their negative
>representations differ.

Are you sure that's one's complement? Lools like sign&magnitude to me.

- Brian

```
 0

2 Replies
1031 Views

Similar Articles

12/11/2013 12:48:17 AM
page loaded in 42419 ms. (0)

Similar Artilces:

Xilinx 8.1i: Testbench waveform from VHDL netlist does not work ??
In ISE 8.1i creating a Testbench waveform does not work for a Schematic TOP Level project with VHDL set as the language for HDL Functional Language Model (Verilog is the default, in 8.1i the Simulation generated language option was removed from the project properties) Testbench waveform works for Verilog netlist and it works in 7.1i for VHDL too. I tried 8.1i SP1 but it did not help. Does anyone have the same problem? Thanks ...

Need help for Xilinx FPGA
Hi, The volunteer CPCNG Design Team is working on a family computer based on eZ80 CPU. We have designed a board (euroboard, 160x110, 4 layers, as you can see at http://cpcng.hytherion.com). Gerber files are ready for production. We search someone to help us for the programmation of the Xilinx FPGA (includes the development of IDE, CRTC6845, I/O interception trick, SRAM interface). We have defined the pinout but our last FPGA developer is not able to help us now. We are motivated and interested for fast result. If you're interested to join the team, please contact me at ChristopheGuelff@...

WinHttpCrackUrl and Pound (#) sign. Help Needed
Hi, Forgive me if this question sounds trivial but i am not an expert at WinHttp API's. I am actually doing directory browsing over http and copying files to the client machine. One such path is of this form: http://myserver/Office/Programs/My Program/VC#/VCSPackages/1035/ proj.dll" I would like to emphasize on the "VC#" component in the path above. When i pass the above path to the WinHttpCrackUrl function, it generates following url components: path = http://myserver/Office/Programs/My Program/VC extrainfo = #/VCSPackages/1033/proj.dll As you c...

Multiply using shift, for signed numbers
I'm trying to achieve multiply using one or more shift operations. For example, A = 5*B can be written as A = 4*B + B or A = (B sll 2) + B Now, B is a signed number, so when I do (B sll 2), the shift operation doesn't discriminate the sign bit, and I end up losing it (falls off to the left side). One solution would be to save the MSb of B, perform 'sll' on the rest, and concatenate them together. If B were signed(7 downto 0) : A = ((B(7) & (B(6 downto 0) sll 2)) + B; Is there a better way to do this, perhaps some built-in function I couldn't find? I'm thinking...

xilinx spartan 3 \$99 board...help
Does anyone know if Xilinx released the source files for the demo stuff that comes on the \$99 Spartan 3 board you can order from them (made by digilent). I have the board, and would like to experiment with the vga that is demonstrated in the test demo, but I cannot find any reference to any source files. Thanks, Hank On Sat, 10 Jul 2004 00:36:10 GMT, "Hank" <nospam@nospam.com> wrote: >Does anyone know if Xilinx released the source files for the demo stuff that >comes on the \$99 Spartan 3 board you can order from them (made by digilent). I >have the board, and w...

Help with autochanging a number in a custom property (Macro)
Can someone help me with the macro below. The macro opens a part, then changes the "Serial" custom property, then saves the file as "Serial" and the number in the customer property. I am trying to figure out how to auto change this number. I have 100 parts to change this note, and it would be nice to run a macro to auto change the custom property, then save it as a file with "Serial000001.sldprt, Serial000002.sldprt, etc etc) Dim swApp As Object Dim Part As Object Dim boolstatus As Boolean Dim longstatus As Long Dim Annotation As Object Dim Gtol As Object Dim Dat...

where to get Xilinx Driver API document?help!
where can I get the docs that specify the usage of Xilinx Driver API? I found all the docs Xilinx provides are talking on how to use the GUI or specify its hardware products,but little comments on how to create a software application with microblaze. Or if you own any tips of writting software application,do you mind sharing it?I'm urgently consulting it. thank you ...

Help with ram controller on Xilinx Spartan IIE
Hi together. I'm relatively new with FPGAs and I have no experience with rams. Now I'm working on a ram controller for a MEMEC FPGA board with a xilinx spartan IIE (@100 MHz). It should be a very simple module, and speed is not very important, because the data to be written come at a low frequency. So I designed a state-machine, which handles the signals. Unfortunately it does not work, although in the simulation the signals have the correct form. At this point I have some questions: 1.) Do I have to instantiate special IO-buffers for the ram signals? The synthesis creates IO-Buffer...

Sign extension issue in Xilinx Multiplier CoreGen version10
I am using Xilinx Coregen and ISE 9.2i and see this peculiar issue with the Multiplier core v10.0. The Xilinx Coregen multiplier has a problem handling signed inputs, particularly when the inputs have greater than 18 bits, the size of the hardware multiplier. For instance, we have an example where a negative 26-bit value is multiplied by a positive 24-bit value. A Coregen core is created to do this arithmetic using four DSP48 cores. The resulting 50-bit output should be negative, but the core produces a positive number. We are using ISE9.2i with all of the SP updates. The Multiplier versi...

converting exact numbers to binary fixed-point representation
Hi group, what I want to achieve is to represent the exact value of an irrational number, say Sin[2*Pi*131/8191], as a binary fixed-point number having 16 fractional (plus one sign bit) bits. First, I thought of converting to floating-point value and then converting to fixed-point using: Floor[N[Sin[2*Pi*(131/8191)]]*2^16] Now I'm worried about the precision of this conversion. The piece of code above truncates all fractional bits that occur after the left shift operation. The following two intermediate results (I changed to 4 bits for simplicity here) 1101,000....

I would like to be able to read the "reg" property from either user mode or kernel mode. From that I can get bus device and function numbers, and also vendor and device id (although the latter i can read easily from config space). I would rather know how to get this information from both user and kernel mode, but even one would be sufficient. I have tried with ddi_prop_lookup_int_array in my driver: error = ddi_prop_lookup_int_array(dev, dip, DDI_PROP_CANSLEEP, "reg", &datap, &num); if(error == DDI_PROP_SUCCESS) ddi_prop_free(datap); I keep getting error = 1, m...

Need help creating a carved wooden plaque/sign
Hi, First let me say that my Gimp skills arent that great. I'm still very much a newbie. I know this project I'm attempting exceeds my abilities, but I'm trying anyway, although without much success. I would like to create a wooden sign (for a webpage) that looks like the lettering is carved out. I want the letters to look carved into the wood, not the letters raised and the background carved away. I forget the exact term for this type of carving. Anyway, for the sign, I want two lines of text at different heights and I want the sign look like it's edges were chamfered....

Simulating EDIF from DK with Xilinx ISE waveform analyzer
Dear all: When I generate an EDIF from Handel-C in DK3.1, I want simulate it with Xilinx ISE waveform analyzer, but always the output signals appear with the "U" (undefined) value (I test it creating a schematic symbol from EDIF with the edif2sym tool). This problem also exists using modelsim waveform analyzer. With older Xilinx Foundation 4 this problem doesn't appear (in this version, the schematic symbol is generated from EDIF as menu option in the schematic tools). For example, I've used the following code for testing purposes: //Test /*===============================...

Beginner help with VHDL, Xilinx 9536XL, and ISE7.1
So I need some help getting started with programmable logic and VHDL. In the past all I have done in the programmable logic area are 16V8 and 22V10 PALs. I actually feel kind of stupid about the simple questions I am about to ask, since it isn't like I don't know a lot about electonics. I have a BSEE and in the past I've designed DSP boards and motor controllers that control hundreds of amps and make electric forklifts able to lift thousands of pounds. Pretty fun stuff actually. But I am stumped by a few simple things with VHDL, Xilinx ISE 7.1, and the Xilinx XC9536XL experime...

help in creating script to change passwd on a number of remote hosts
I have a large number of remote hosts accessed using ssh. I would like to create a script to change the root passwd on these hosts periodically I have tried using the following hereis file with not much luck file: /bin/passwd root << eof oldpasswd newpasswd eof Appreciate some advice Sammy Ps I'm aware of yellowpages and similar applications but I would like to automate using a shell or possible perl script. "sammy" <kim111@bigpond.net.au> wrote in message news:2indh.3199\$HU.2704@news-server.bigpond.net.au... >I have a large number of remote hosts acc...

Replacement Motherboard Thinkpad T41 Part number help......bluetooth......
I have a Thinkpad T41 w/ bluetooth. Motherboard is bad. Type 2373 -9FU. The part number listed on the bottom is FRU label P/N 91P8927 Having trouble finding a exact replacement, IBM/lenovo changes their part numbers so a range of motherboards would work i just don't know which ones. Hoping someone has the info i seek. Normally I could install a board from any T41?, however mine has bluetooth and i want to make sure i retain bluetooth capability. Any help would be appreciated. Thanx "bman" <brianhubley001@gmail.com> wrote in message news:122c1bd9-d83b-4c34-a7e7-f5e2478...

How to convert ASCII Floating Point Number string to IEEE 754 binary representation?
Hi, anyone! I wrote an x86 assembler recent days, but lack of support of floating point number. Are there any references for that. Thx! TdZ TdZ wrote: > Hi, anyone! > > I wrote an x86 assembler recent days, but lack of support of floating > point number. Are there any references for that. Thx! Converting ascii to fp is easy, doing the opposite is slightly harder. Doing both optimally is an interesting problem, which have generated lots of papers over the years, including a famous pair that were submitted simultaneously, and which described the optimal algorithms. Optimal...

Simulating testbench waveform error: "No feasible entries for subprogram write"
Hi everyone I'm trying to simulate a module from within Xilinx using Modelsim. I have generated a testbench waveform using the inbuilt waveform generator. When I double click on either "Simulate Behavioural Model" (which opens up a Modelsim window) or "Generate Expected Simulation Results" I get the following error: "# ** Error: modmultcontrol_test_1.ant(56): No feasible entries for subprogram write" I have searched on groups and in google for an answer, and from that it looks like it has something to do with the subprogram 'write'. My best guess i...

Question: Writing text file based TestBenches vs. Waveform file based simulation.
I just wanted to know if more people are moving toward waveform based simulations. From my point of view, drawing the actual waveforms to perform the testing (as you can do in Aldec 6.2) makes life much easier, especially since Aldec allows you to save the waveform as a testbench text file. Am I correct in saying that you can't graphically enter a waveform in ModelSim? Writing testbench files to seem very tedious and it takes a great deal of knowledge to write one properly and a lot of time. On the other hand creating a waveform is quicker and more intuitive. Just wanted to know what ...

Help, how to output two complex stepwise waveform generation in AO channel for DAQ card?
Hi, I am a fresh man for Labview. I have a NI-6259 card. &nbsp; I am trying to generate a stepwise waveform from -1 to +1V analog output of AO . &nbsp; For ao0 channel, each step is around 0.005V, and stays for 5ms on every step, therefore there are 400 steps in 2s. &nbsp; For ao1 channel, each step is also 0.005V same with ao0, but stays for a period time after ao0 completing(2s) on every step. In every step, ao1 start to next step after ao0 finish a perid, therefore there are 400 step in 800s to ao1. &nbsp; It is so complex for me&nbsp;that I have no idea. I need help ve...