-
X-Received: by 10.140.21.111 with SMTP id 102mr212389qgk.4.1432427827343; Sat, 23 May
2015 17:37:07 -0700 (PDT)
X-Received: by 10.140.21.111 with SMTP id 102mr212389qgk.4.1432427827343; Sat, 23 May
2015 17:37:07 -0700 (PDT)
Path: news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!go
blin3!goblin.stu.neva.ru!news.ripco.com!news.glorb.com!j8no8568214igd.0!news-ou
t.google.com!4ni34qgh.1!nntp.google.com!z60no3468924qgd.1!postnews.google.com!g
legroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.misc.elektronika
Date: Sat, 23 May 2015 17:37:07 -0700 (PDT)
Complaints-To: g...@g...com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=185.53.155.164;
posting-account=67yd9woAAAAHUu8VHyA7Js47M98NE3m3
NNTP-Posting-Host: 185.53.155.164
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8...@g...com>
Subject: Jeszcze raz VHDL - problem ze zwięzłym zapisem
From: s...@g...com
Injection-Date: Sun, 24 May 2015 00:37:07 +0000
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable
Xref: news-archive.icm.edu.pl pl.misc.elektronika:681699
[ ukryj nagłówki ]Problem jest w zasadzie rozwinięciem poprzedniego wątkaDo rzeczy, układ ma obliczać
coś takiego: C=|R(0)+...+R(15)-R(16)-....-R(31)|, gdzie C,R(i)-liczby 11 bitowe bez
znaku. R(i) są to kolejne sekcje rejestru posuwnego, w którym na pierwszą sekcję jest
podawana 11 bitowa liczba "A" (bez znaku). Układ działa poprawnie zarówno na
symulatorze jak i na żywym organiźmie. Wszystkie operacje +/- zrobiłem krok po kroku.
A co gdybym miał pierdyljon sekcji rejestru posuwnego?
Jak to zwięźlej zapisać? Kod wygląda tak:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
library UNISIM;
use UNISIM.VComponents.all;
entity amod is
Port ( A : in STD_LOGIC_VECTOR (10 downto 0);
CLK : in STD_LOGIC;
C : out STD_LOGIC_VECTOR (10 downto 0));
end amod;
architecture Behavioral of amod is
type Shift_Register_Type is array (31 downto 0) of std_logic_vector(10 downto 0);
signal Cs:std_logic_vector(14 downto 0):="000000000000000";
signal Rejestr:Shift_Register_Type;
begin
process(CLK)
begin
if rising_edge(CLK) then
Rejestr<=Rejestr(30 downto 0)&A;
Cs<=std_logic_vector(to_unsigned(abs(to_integer(sign
ed('0'&Rejestr(0)))+
to_integer(signed('0'&Rejestr(1)))+
to_integer(signed('0'&Rejestr(2)))+
to_integer(signed('0'&Rejestr(3)))+
to_integer(signed('0'&Rejestr(4)))+
to_integer(signed('0'&Rejestr(5)))+
to_integer(signed('0'&Rejestr(6)))+
to_integer(signed('0'&Rejestr(7)))+
to_integer(signed('0'&Rejestr(8)))+
to_integer(signed('0'&Rejestr(9)))+
to_integer(signed('0'&Rejestr(10)))+
to_integer(signed('0'&Rejestr(11)))+
to_integer(signed('0'&Rejestr(12)))+
to_integer(signed('0'&Rejestr(13)))+
to_integer(signed('0'&Rejestr(14)))+
to_integer(signed('0'&Rejestr(15)))-
to_integer(signed('0'&Rejestr(16)))-
to_integer(signed('0'&Rejestr(17)))-
to_integer(signed('0'&Rejestr(18)))-
to_integer(signed('0'&Rejestr(19)))-
to_integer(signed('0'&Rejestr(20)))-
to_integer(signed('0'&Rejestr(21)))-
to_integer(signed('0'&Rejestr(22)))-
to_integer(signed('0'&Rejestr(23)))-
to_integer(signed('0'&Rejestr(24)))-
to_integer(signed('0'&Rejestr(25)))-
to_integer(signed('0'&Rejestr(26)))-
to_integer(signed('0'&Rejestr(27)))-
to_integer(signed('0'&Rejestr(28)))-
to_integer(signed('0'&Rejestr(29)))-
to_integer(signed('0'&Rejestr(30)))-
to_integer(signed('0'&Rejestr(31)))),15));
end if;
end process;
C<=Cs(14 downto 4);
end Behavioral;
Następne wpisy z tego wątku
- 24.05.15 22:38 Jakub Rakus
- 24.05.15 23:34 s...@g...com
- 25.05.15 21:52 Jakub Rakus
- 25.05.15 23:27 s...@g...com
- 26.05.15 10:36 J.F.
- 27.05.15 08:48 s...@g...com
- 27.05.15 10:40 J.F.
- 27.05.15 11:55 s...@g...com
- 27.05.15 12:09 J.F.
- 27.05.15 17:26 s...@g...com
- 27.05.15 17:40 J.F.
- 27.05.15 19:29 s...@g...com
- 29.05.15 12:48 s...@g...com
- 29.05.15 13:39 J.F.
- 29.05.15 22:23 s...@g...com
Najnowsze wątki z tej grupy
- Smar do video
- Litowe baterie AA Li/FeS2 a alkaliczne
- "ogrodowa linia napowietrzna"
- jaki zasilacz laboratoryjny
- jaki zasilacz laboratoryjny
- Puszka w ziemię
- T-1000 was here
- Ściąganie hasła frezem
- Koszyk okrągły, walec 3x AA, na duże paluszki R6
- Brak bolca ochronnego ładowarki oznacza pożar
- AMS spalony szybkim zasilaczem USB
- stalowe bezpieczniki
- Wyświtlacz ramki cyfrowej
- bateria na żądanie
- pradnica krokowa
Najnowsze wątki
- 2025-02-06 PROGRAM DOPŁAT DO AUT ELEKTRYCZNYCH TO ABSURD. ZA ŚRODKI Z KPO KUPIMY NIEMIECKIE I CHIŃSKIE AUTA
- 2025-02-05 ceny OC
- 2025-02-05 Re: ceny OC
- 2025-02-05 Re: ceny OC
- 2025-02-07 Smar do video
- 2025-02-06 Litowe baterie AA Li/FeS2 a alkaliczne
- 2025-02-07 Gliwice => Business Development Manager - Network and Network Security
- 2025-02-07 Warszawa => System Architect (Java background) <=
- 2025-02-07 Warszawa => System Architect (background deweloperski w Java) <=
- 2025-02-07 Warszawa => Solution Architect (Java background) <=
- 2025-02-07 Gliwice => Ekspert IT (obszar systemów sieciowych) <=
- 2025-02-07 Lublin => Programista Delphi <=
- 2025-02-07 Warszawa => Architekt rozwiązań (doświadczenie w obszarze Java, AWS
- 2025-02-07 Dęblin => Node.js / Fullstack Developer <=
- 2025-02-07 Bieruń => Spedytor Międzynarodowy (handel ładunkami/prowadzenie flo