Convert from unsigned to two's complement inside CPLD. TODO: This requires changes to gr-osmosdr and software that uses hackrf_transfer files directly.

This commit is contained in:
Jared Boone
2013-09-16 14:59:14 -07:00
parent 7075cc6c1c
commit 0a46aae5b9

View File

@ -93,7 +93,7 @@ begin
process(host_clk_i)
begin
if rising_edge(host_clk_i) then
data_to_host_o <= adc_data_i;
data_to_host_o <= adc_data_i xor X"80";
end if;
end process;
@ -101,7 +101,7 @@ begin
begin
if rising_edge(host_clk_i) then
if transfer_direction_i = to_dac then
dac_data_o <= data_from_host_i & "00";
dac_data_o <= (data_from_host_i xor X"80") & "00";
else
dac_data_o <= (dac_data_o'high => '1', others => '0');
end if;