ferrouga
Newbie level 4
- Joined
- Nov 15, 2005
- Messages
- 6
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,420
Hi friends,
hop u r ok,
I have a problem with this QPSK code :
I am doing it with Xilinx, so I have just one output vector NA with multi-source deg, deg1, deg2 and deg3,
How can I fix this kind of problem
PS: I trying to create a QPSK modulation by this code
hop u r ok,
I have a problem with this QPSK code :
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 library IEEE; use IEEE.std_logic_1164.all; -- defines std_logic types use IEEE.STD_LOGIC_ARITH.all; use IEEE.STD_LOGIC_UNSIGNED.all; entity Sinus is port ( CLK : in STD_LOGIC; --INFA: in std_logic; -- --INFB: in std_logic; --OUTP: out std_logic; data : in STD_LOGIC_VECTOR (1 downto 0); -- NA : out STD_LOGIC_VECTOR (7 downto 0) -- Sorties numérique pour le convertisseur NA ); end Sinus; architecture Sinus_arch of Sinus is signal deg : INTEGER range 0 to 64 := 0; signal deg1 : INTEGER range 0 to 64 := 0; signal deg2 : INTEGER range 0 to 64 := 0; signal deg3 : INTEGER range 0 to 64 := 0; -- signal NA_int : INTEGER range 0 to 255 := 0; -- -- signal pas_int : integer range 0 to 128 := 5; -- begin process (CLK,data) begin if (CLK'event and CLK='1') then -- CLK rising edge ----------------------------------------------------- if (data="00") then deg <= deg+1; if deg >63 then deg <= deg-64; end if; end if; ------------------------------------------------------ if (data="01") then deg1 <= deg1+1; if deg1 >63 then deg1 <= deg1-64; end if; end if ; ------------------------------------------------------ if (data="10") then deg2 <= deg2+1; if deg2 >63 then deg2<= deg2-64; end if; end if ; ------------------------------------------------------ if (data="11") then deg3 <= deg3+1; if deg3 >63 then deg3<= deg3-64; end if; end if; end if; end process; --OUTP <= INFA xor INFB; --------- dephasage de 45 deg with deg select NA<=CONV_STD_LOGIC_VECTOR( 218 ,8) when 0 , CONV_STD_LOGIC_VECTOR( 226 ,8) when 1 , CONV_STD_LOGIC_VECTOR( 234 ,8) when 2 , CONV_STD_LOGIC_VECTOR( 240 ,8) when 3 , CONV_STD_LOGIC_VECTOR( 246 ,8) when 4 , CONV_STD_LOGIC_VECTOR( 250 ,8) when 5 , CONV_STD_LOGIC_VECTOR( 253 ,8) when 6 , CONV_STD_LOGIC_VECTOR( 254 ,8) when 7 , CONV_STD_LOGIC_VECTOR( 255 ,8) when 8 , CONV_STD_LOGIC_VECTOR( 254 ,8) when 9 , CONV_STD_LOGIC_VECTOR( 252 ,8) when 10 , CONV_STD_LOGIC_VECTOR( 249 ,8) when 11 , CONV_STD_LOGIC_VECTOR( 245 ,8) when 12 , CONV_STD_LOGIC_VECTOR( 240 ,8) when 13 , CONV_STD_LOGIC_VECTOR( 233 ,8) when 14 , CONV_STD_LOGIC_VECTOR( 225 ,8) when 15 , CONV_STD_LOGIC_VECTOR( 217 ,8) when 16 , CONV_STD_LOGIC_VECTOR( 208 ,8) when 17 , CONV_STD_LOGIC_VECTOR( 197 ,8) when 18 , CONV_STD_LOGIC_VECTOR( 187 ,8) when 19 , CONV_STD_LOGIC_VECTOR( 175 ,8) when 20 , CONV_STD_LOGIC_VECTOR( 164 ,8) when 21 , CONV_STD_LOGIC_VECTOR( 151 ,8) when 22 , CONV_STD_LOGIC_VECTOR( 139 ,8) when 23 , CONV_STD_LOGIC_VECTOR( 126 ,8) when 24 , CONV_STD_LOGIC_VECTOR( 114 ,8) when 25 , CONV_STD_LOGIC_VECTOR( 102 ,8) when 26 , CONV_STD_LOGIC_VECTOR( 89 ,8) when 27 , CONV_STD_LOGIC_VECTOR( 78 ,8) when 28 , CONV_STD_LOGIC_VECTOR( 67 ,8) when 29 , CONV_STD_LOGIC_VECTOR( 56 ,8) when 30 , CONV_STD_LOGIC_VECTOR( 46 ,8) when 31 , CONV_STD_LOGIC_VECTOR( 37 ,8) when 32 , CONV_STD_LOGIC_VECTOR( 29 ,8) when 33 , CONV_STD_LOGIC_VECTOR( 21 ,8) when 34 , CONV_STD_LOGIC_VECTOR( 15 ,8) when 35 , CONV_STD_LOGIC_VECTOR( 10 ,8) when 36 , CONV_STD_LOGIC_VECTOR( 6 ,8) when 37 , CONV_STD_LOGIC_VECTOR( 3 ,8) when 38 , CONV_STD_LOGIC_VECTOR( 1 ,8) when 39 , CONV_STD_LOGIC_VECTOR( 1 ,8) when 40 , CONV_STD_LOGIC_VECTOR( 2 ,8) when 41 , CONV_STD_LOGIC_VECTOR( 4 ,8) when 42 , CONV_STD_LOGIC_VECTOR( 7 ,8) when 43 , CONV_STD_LOGIC_VECTOR( 12 ,8) when 44 , CONV_STD_LOGIC_VECTOR( 17 ,8) when 45 , CONV_STD_LOGIC_VECTOR( 24 ,8) when 46 , CONV_STD_LOGIC_VECTOR( 32 ,8) when 47 , CONV_STD_LOGIC_VECTOR( 40 ,8) when 48 , CONV_STD_LOGIC_VECTOR( 50 ,8) when 49 , CONV_STD_LOGIC_VECTOR( 60 ,8) when 50 , CONV_STD_LOGIC_VECTOR( 71 ,8) when 51 , CONV_STD_LOGIC_VECTOR( 82 ,8) when 52 , CONV_STD_LOGIC_VECTOR( 94 ,8) when 53 , CONV_STD_LOGIC_VECTOR( 106 ,8) when 54 , CONV_STD_LOGIC_VECTOR( 119 ,8) when 55 , CONV_STD_LOGIC_VECTOR( 128 ,8) when 56 , CONV_STD_LOGIC_VECTOR( 128 ,8) when 57 , CONV_STD_LOGIC_VECTOR( 140 ,8) when 58 , CONV_STD_LOGIC_VECTOR( 153 ,8) when 59 , CONV_STD_LOGIC_VECTOR( 165 ,8) when 60 , CONV_STD_LOGIC_VECTOR( 177 ,8) when 61 , CONV_STD_LOGIC_VECTOR( 188 ,8) when 62 , CONV_STD_LOGIC_VECTOR( 199 ,8) when 63 , CONV_STD_LOGIC_VECTOR( 209 ,8) when 64 ; -------------- dephasage de135 deg with deg1 select NA<=CONV_STD_LOGIC_VECTOR( 217 ,8) when 0 , CONV_STD_LOGIC_VECTOR( 208 ,8) when 1 , CONV_STD_LOGIC_VECTOR( 197 ,8) when 2 , CONV_STD_LOGIC_VECTOR( 187 ,8) when 3 , CONV_STD_LOGIC_VECTOR( 175 ,8) when 4 , CONV_STD_LOGIC_VECTOR( 164 ,8) when 5 , CONV_STD_LOGIC_VECTOR( 151 ,8) when 6 , CONV_STD_LOGIC_VECTOR( 139 ,8) when 7 , CONV_STD_LOGIC_VECTOR( 126 ,8) when 8 , CONV_STD_LOGIC_VECTOR( 114 ,8) when 9 , CONV_STD_LOGIC_VECTOR( 102 ,8) when 10 , CONV_STD_LOGIC_VECTOR( 89 ,8) when 11 , CONV_STD_LOGIC_VECTOR( 78 ,8) when 12 , CONV_STD_LOGIC_VECTOR( 67 ,8) when 13 , CONV_STD_LOGIC_VECTOR( 56 ,8) when 14 , CONV_STD_LOGIC_VECTOR( 46 ,8) when 15 , CONV_STD_LOGIC_VECTOR( 37 ,8) when 16 , CONV_STD_LOGIC_VECTOR( 29 ,8) when 17 , CONV_STD_LOGIC_VECTOR( 21 ,8) when 18 , CONV_STD_LOGIC_VECTOR( 15 ,8) when 19 , CONV_STD_LOGIC_VECTOR( 10 ,8) when 20 , CONV_STD_LOGIC_VECTOR( 6 ,8) when 21 , CONV_STD_LOGIC_VECTOR( 3 ,8) when 22 , CONV_STD_LOGIC_VECTOR( 1 ,8) when 23 , CONV_STD_LOGIC_VECTOR( 1 ,8) when 24 , CONV_STD_LOGIC_VECTOR( 2 ,8) when 25 , CONV_STD_LOGIC_VECTOR( 4 ,8) when 26 , CONV_STD_LOGIC_VECTOR( 7 ,8) when 27 , CONV_STD_LOGIC_VECTOR( 12 ,8) when 28 , CONV_STD_LOGIC_VECTOR( 17 ,8) when 29 , CONV_STD_LOGIC_VECTOR( 24 ,8) when 30 , CONV_STD_LOGIC_VECTOR( 32 ,8) when 31 , CONV_STD_LOGIC_VECTOR( 40 ,8) when 32 , CONV_STD_LOGIC_VECTOR( 50 ,8) when 33 , CONV_STD_LOGIC_VECTOR( 60 ,8) when 34 , CONV_STD_LOGIC_VECTOR( 71 ,8) when 35 , CONV_STD_LOGIC_VECTOR( 82 ,8) when 36 , CONV_STD_LOGIC_VECTOR( 94 ,8) when 37 , CONV_STD_LOGIC_VECTOR( 106 ,8) when 38 , CONV_STD_LOGIC_VECTOR( 119 ,8) when 39 , CONV_STD_LOGIC_VECTOR( 128 ,8) when 40 , CONV_STD_LOGIC_VECTOR( 128 ,8) when 41 , CONV_STD_LOGIC_VECTOR( 140 ,8) when 42 , CONV_STD_LOGIC_VECTOR( 153 ,8) when 43 , CONV_STD_LOGIC_VECTOR( 165 ,8) when 44 , CONV_STD_LOGIC_VECTOR( 177 ,8) when 45 , CONV_STD_LOGIC_VECTOR( 188 ,8) when 46 , CONV_STD_LOGIC_VECTOR( 199 ,8) when 47 , CONV_STD_LOGIC_VECTOR( 209 ,8) when 48 , CONV_STD_LOGIC_VECTOR( 218 ,8) when 49 , CONV_STD_LOGIC_VECTOR( 226 ,8) when 50 , CONV_STD_LOGIC_VECTOR( 234 ,8) when 51 , CONV_STD_LOGIC_VECTOR( 240 ,8) when 52 , CONV_STD_LOGIC_VECTOR( 246 ,8) when 53 , CONV_STD_LOGIC_VECTOR( 250 ,8) when 54 , CONV_STD_LOGIC_VECTOR( 253 ,8) when 55 , CONV_STD_LOGIC_VECTOR( 254 ,8) when 56 , CONV_STD_LOGIC_VECTOR( 255 ,8) when 57 , CONV_STD_LOGIC_VECTOR( 254 ,8) when 58 , CONV_STD_LOGIC_VECTOR( 252 ,8) when 59 , CONV_STD_LOGIC_VECTOR( 249 ,8) when 60 , CONV_STD_LOGIC_VECTOR( 245 ,8) when 61 , CONV_STD_LOGIC_VECTOR( 240 ,8) when 62 , CONV_STD_LOGIC_VECTOR( 233 ,8) when 63 , CONV_STD_LOGIC_VECTOR( 225 ,8) when 64 ; ------------- dephasage de 225 deg with deg2 select NA<=CONV_STD_LOGIC_VECTOR( 37 ,8) when 0 , CONV_STD_LOGIC_VECTOR( 29 ,8) when 1 , CONV_STD_LOGIC_VECTOR( 21 ,8) when 2 , CONV_STD_LOGIC_VECTOR( 15 ,8) when 3 , CONV_STD_LOGIC_VECTOR( 10 ,8) when 4 , CONV_STD_LOGIC_VECTOR( 6 ,8) when 5 , CONV_STD_LOGIC_VECTOR( 3 ,8) when 6 , CONV_STD_LOGIC_VECTOR( 1 ,8) when 7 , CONV_STD_LOGIC_VECTOR( 1 ,8) when 8 , CONV_STD_LOGIC_VECTOR( 2 ,8) when 9 , CONV_STD_LOGIC_VECTOR( 4 ,8) when 10 , CONV_STD_LOGIC_VECTOR( 7 ,8) when 11 , CONV_STD_LOGIC_VECTOR( 12 ,8) when 12 , CONV_STD_LOGIC_VECTOR( 17 ,8) when 13 , CONV_STD_LOGIC_VECTOR( 24 ,8) when 14 , CONV_STD_LOGIC_VECTOR( 32 ,8) when 15 , CONV_STD_LOGIC_VECTOR( 40 ,8) when 16 , CONV_STD_LOGIC_VECTOR( 50 ,8) when 17 , CONV_STD_LOGIC_VECTOR( 60 ,8) when 18 , CONV_STD_LOGIC_VECTOR( 71 ,8) when 19 , CONV_STD_LOGIC_VECTOR( 82 ,8) when 20 , CONV_STD_LOGIC_VECTOR( 94 ,8) when 21 , CONV_STD_LOGIC_VECTOR( 106 ,8) when 22 , CONV_STD_LOGIC_VECTOR( 119 ,8) when 23 , CONV_STD_LOGIC_VECTOR( 128 ,8) when 24 , CONV_STD_LOGIC_VECTOR( 128 ,8) when 25 , CONV_STD_LOGIC_VECTOR( 140 ,8) when 26 , CONV_STD_LOGIC_VECTOR( 153 ,8) when 27 , CONV_STD_LOGIC_VECTOR( 165 ,8) when 28 , CONV_STD_LOGIC_VECTOR( 177 ,8) when 29 , CONV_STD_LOGIC_VECTOR( 188 ,8) when 30 , CONV_STD_LOGIC_VECTOR( 199 ,8) when 31 , CONV_STD_LOGIC_VECTOR( 209 ,8) when 32 , CONV_STD_LOGIC_VECTOR( 218 ,8) when 33 , CONV_STD_LOGIC_VECTOR( 226 ,8) when 34 , CONV_STD_LOGIC_VECTOR( 234 ,8) when 35 , CONV_STD_LOGIC_VECTOR( 240 ,8) when 36 , CONV_STD_LOGIC_VECTOR( 246 ,8) when 37 , CONV_STD_LOGIC_VECTOR( 250 ,8) when 38 , CONV_STD_LOGIC_VECTOR( 253 ,8) when 39 , CONV_STD_LOGIC_VECTOR( 254 ,8) when 40 , CONV_STD_LOGIC_VECTOR( 255 ,8) when 41 , CONV_STD_LOGIC_VECTOR( 254 ,8) when 42 , CONV_STD_LOGIC_VECTOR( 252 ,8) when 43 , CONV_STD_LOGIC_VECTOR( 249 ,8) when 44 , CONV_STD_LOGIC_VECTOR( 245 ,8) when 45 , CONV_STD_LOGIC_VECTOR( 240 ,8) when 46 , CONV_STD_LOGIC_VECTOR( 233 ,8) when 47 , CONV_STD_LOGIC_VECTOR( 225 ,8) when 48 , CONV_STD_LOGIC_VECTOR( 217 ,8) when 49 , CONV_STD_LOGIC_VECTOR( 208 ,8) when 50 , CONV_STD_LOGIC_VECTOR( 197 ,8) when 51 , CONV_STD_LOGIC_VECTOR( 187 ,8) when 52 , CONV_STD_LOGIC_VECTOR( 175 ,8) when 53 , CONV_STD_LOGIC_VECTOR( 164 ,8) when 54 , CONV_STD_LOGIC_VECTOR( 151 ,8) when 55 , CONV_STD_LOGIC_VECTOR( 139 ,8) when 56 , CONV_STD_LOGIC_VECTOR( 126 ,8) when 57 , CONV_STD_LOGIC_VECTOR( 114 ,8) when 58 , CONV_STD_LOGIC_VECTOR( 102 ,8) when 59 , CONV_STD_LOGIC_VECTOR( 89 ,8) when 60 , CONV_STD_LOGIC_VECTOR( 78 ,8) when 61 , CONV_STD_LOGIC_VECTOR( 67 ,8) when 62 , CONV_STD_LOGIC_VECTOR( 56 ,8) when 63 , CONV_STD_LOGIC_VECTOR( 46 ,8) when 64 ; ------------- dephasage de 315 deg with deg3 select NA<=CONV_STD_LOGIC_VECTOR( 40 ,8) when 0 , CONV_STD_LOGIC_VECTOR( 50 ,8) when 1 , CONV_STD_LOGIC_VECTOR( 60 ,8) when 2 , CONV_STD_LOGIC_VECTOR( 71 ,8) when 3 , CONV_STD_LOGIC_VECTOR( 82 ,8) when 4 , CONV_STD_LOGIC_VECTOR( 94 ,8) when 5 , CONV_STD_LOGIC_VECTOR( 106 ,8) when 6 , CONV_STD_LOGIC_VECTOR( 119 ,8) when 7 , CONV_STD_LOGIC_VECTOR( 128 ,8) when 8 , CONV_STD_LOGIC_VECTOR( 128 ,8) when 9 , CONV_STD_LOGIC_VECTOR( 140 ,8) when 10 , CONV_STD_LOGIC_VECTOR( 153 ,8) when 11 , CONV_STD_LOGIC_VECTOR( 165 ,8) when 12 , CONV_STD_LOGIC_VECTOR( 177 ,8) when 13 , CONV_STD_LOGIC_VECTOR( 188 ,8) when 14 , CONV_STD_LOGIC_VECTOR( 199 ,8) when 15 , CONV_STD_LOGIC_VECTOR( 209 ,8) when 16 , CONV_STD_LOGIC_VECTOR( 218 ,8) when 17 , CONV_STD_LOGIC_VECTOR( 226 ,8) when 18 , CONV_STD_LOGIC_VECTOR( 234 ,8) when 19 , CONV_STD_LOGIC_VECTOR( 240 ,8) when 20 , CONV_STD_LOGIC_VECTOR( 246 ,8) when 21 , CONV_STD_LOGIC_VECTOR( 250 ,8) when 22 , CONV_STD_LOGIC_VECTOR( 253 ,8) when 23 , CONV_STD_LOGIC_VECTOR( 254 ,8) when 24 , CONV_STD_LOGIC_VECTOR( 255 ,8) when 25 , CONV_STD_LOGIC_VECTOR( 254 ,8) when 26 , CONV_STD_LOGIC_VECTOR( 252 ,8) when 27 , CONV_STD_LOGIC_VECTOR( 249 ,8) when 28 , CONV_STD_LOGIC_VECTOR( 245 ,8) when 29 , CONV_STD_LOGIC_VECTOR( 240 ,8) when 30 , CONV_STD_LOGIC_VECTOR( 233 ,8) when 31 , CONV_STD_LOGIC_VECTOR( 225 ,8) when 32 , CONV_STD_LOGIC_VECTOR( 217 ,8) when 33 , CONV_STD_LOGIC_VECTOR( 208 ,8) when 34 , CONV_STD_LOGIC_VECTOR( 197 ,8) when 35 , CONV_STD_LOGIC_VECTOR( 187 ,8) when 36 , CONV_STD_LOGIC_VECTOR( 175 ,8) when 37 , CONV_STD_LOGIC_VECTOR( 164 ,8) when 38 , CONV_STD_LOGIC_VECTOR( 151 ,8) when 39 , CONV_STD_LOGIC_VECTOR( 139 ,8) when 40 , CONV_STD_LOGIC_VECTOR( 126 ,8) when 41 , CONV_STD_LOGIC_VECTOR( 114 ,8) when 42 , CONV_STD_LOGIC_VECTOR( 102 ,8) when 43 , CONV_STD_LOGIC_VECTOR( 89 ,8) when 44 , CONV_STD_LOGIC_VECTOR( 78 ,8) when 45 , CONV_STD_LOGIC_VECTOR( 67 ,8) when 46 , CONV_STD_LOGIC_VECTOR( 56 ,8) when 47 , CONV_STD_LOGIC_VECTOR( 46 ,8) when 48 , CONV_STD_LOGIC_VECTOR( 37 ,8) when 49 , CONV_STD_LOGIC_VECTOR( 29 ,8) when 50 , CONV_STD_LOGIC_VECTOR( 21 ,8) when 51 , CONV_STD_LOGIC_VECTOR( 15 ,8) when 52 , CONV_STD_LOGIC_VECTOR( 10 ,8) when 53 , CONV_STD_LOGIC_VECTOR( 6 ,8) when 54 , CONV_STD_LOGIC_VECTOR( 3 ,8) when 55 , CONV_STD_LOGIC_VECTOR( 1 ,8) when 56 , CONV_STD_LOGIC_VECTOR( 1 ,8) when 57 , CONV_STD_LOGIC_VECTOR( 2 ,8) when 58 , CONV_STD_LOGIC_VECTOR( 4 ,8) when 59 , CONV_STD_LOGIC_VECTOR( 7 ,8) when 60 , CONV_STD_LOGIC_VECTOR( 12 ,8) when 61 , CONV_STD_LOGIC_VECTOR( 17 ,8) when 62 , CONV_STD_LOGIC_VECTOR( 24 ,8) when 63 , CONV_STD_LOGIC_VECTOR( 32 ,8) when 64 , conv_std_logic_vector(127,8) when others; end sinus_arch; --CONV_STD_LOGIC_VECTOR( 0 ,8) when others ; --NA <= CONV_STD_LOGIC_VECTOR(NA_int,8); --end Sinus_arch;
I am doing it with Xilinx, so I have just one output vector NA with multi-source deg, deg1, deg2 and deg3,
How can I fix this kind of problem
PS: I trying to create a QPSK modulation by this code
Last edited by a moderator: