zidong
Guest
Tue Oct 05, 2010 9:10 am
Design a circuit that has the following function:
If C=00: shift A one step to the left (“shift in” ’0’ on LSB)
If C=01: shift A one step to the right (“shift in” ’0’ on MSB)
If C =10: rotate A one step left
If C=11: rotate A one step right
Input: A (std_logic_vector(7 downto 0))
C (std_logic_vector(1 downto 0)
Output: Z (std_logic_vector(7 downto 0)) – the result of the shifting
or rotation of
A
thanks in advance.
Tricky
Guest
Tue Oct 05, 2010 11:00 am
On 5 Oct, 07:10, zidong <zidong.m...@gmail.com> wrote:
Quote:
Design a circuit that has the following function:
If C=00: shift A one step to the left (“shift in” ’0’ on LSB)
If C=01: shift A one step to the right (“shift in” ’0’ on MSB)
If C =10: rotate A one step left
If C=11: rotate A one step right
Input: A (std_logic_vector(7 downto 0))
C (std_logic_vector(1 downto 0)
Output: Z (std_logic_vector(7 downto 0)) – the result of the shifting
or rotation of
A
thanks in advance.
Heres a good start:
library ieee;
use ieee.std_logic_1164.all;
entity some_bloke_on_the_internet_did_my_assignment_for_me is
port (
A : in std_logic_vector(7 downto 0);
C : in std_logic_vector(1 downto 0);
Z : out std_logic_vector(7 downto 0)
);
end entity some_bloke_on_the_internet_did_my_assignment_for_me;
architecture I_wrote_this_bit of
some_bloke_on_the_internet_did_my_assignment_for_me is
begin
--place your code here - come back when you get stuck
end architecture I_wrote_this_bit;
Andy
Guest
Tue Oct 05, 2010 4:30 pm
I think it is a very nice question.
Andy
KJ
Guest
Tue Oct 05, 2010 6:07 pm
On Oct 5, 9:30 am, Andy <jonesa...@comcast.net> wrote:
Quote:
I think it is a very nice question.
Andy
Except for the subject line, I didn't see any question. A bait-and-
switch from my view. But maybe a question could have been a very nice
question. I wonder if the OP is simulating new dance moves?
KJ
backhus
Guest
Fri Oct 08, 2010 9:38 am
On 5 Okt., 17:07, KJ <kkjenni...@sbcglobal.net> wrote:
Quote:
On Oct 5, 9:30 am, Andy <jonesa...@comcast.net> wrote:
I think it is a very nice question.
Andy
Except for the subject line, I didn't see any question. A bait-and-
switch from my view. But maybe a question could have been a very nice
question. I wonder if the OP is simulating new dance moves?
KJ
Hi KJ,
dance move generator, what a brilliant idea!
Take four of these connected to random generators (two legs * x/y
position),
and don't forget the twister(tm)-detector to avoid impossible moves.
With some input (3x3 step mat) and output stuff(3x3 LED) you can put a
dance game into a single CPLD.
More simple minds would suspect this assignment to be an
implementation of the shift execution block of some simple processor
core.
The two bits of C could be part of the opcode, so all rotate/shift
commands can use a common opcode, that differs only by these two bits.
But how boring sounds that.... :-)
Have a nice synthesis
Eilert