Velocity Reviews > VHDL > Can you give some idea about the question?

# Can you give some idea about the question?

zidong
Guest
Posts: n/a

 10-05-2010
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

Tricky
Guest
Posts: n/a

 10-05-2010
On 5 Oct, 07:10, zidong <(E-Mail Removed)> wrote:
> 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
>

Heres a good start:

library ieee;
use ieee.std_logic_1164.all;

entity some_bloke_on_the_internet_did_my_assignment_for_m e 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_m e;

architecture I_wrote_this_bit of
some_bloke_on_the_internet_did_my_assignment_for_m e is
begin
--place your code here - come back when you get stuck
end architecture I_wrote_this_bit;

Andy
Guest
Posts: n/a

 10-05-2010
I think it is a very nice question.

Andy

KJ
Guest
Posts: n/a

 10-05-2010
On Oct 5, 9:30*am, Andy <(E-Mail Removed)> 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

backhus
Guest
Posts: n/a

 10-08-2010
On 5 Okt., 17:07, KJ <(E-Mail Removed)> wrote:
> On Oct 5, 9:30*am, Andy <(E-Mail Removed)> 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