From 0a46aae5b9b76a3550d77b3e89f0c536b2808657 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Mon, 16 Sep 2013 14:59:14 -0700 Subject: [PATCH] Convert from unsigned to two's complement inside CPLD. TODO: This requires changes to gr-osmosdr and software that uses hackrf_transfer files directly. --- firmware/cpld/sgpio_if/top.vhd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/cpld/sgpio_if/top.vhd b/firmware/cpld/sgpio_if/top.vhd index a1507238..ce3bbfa8 100755 --- a/firmware/cpld/sgpio_if/top.vhd +++ b/firmware/cpld/sgpio_if/top.vhd @@ -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;