# Can you give some idea about the question?

Discussion in 'VHDL' started by zidong, Oct 5, 2010.

1. ### zidongGuest

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

zidong, Oct 5, 2010

2. ### TrickyGuest

On 5 Oct, 07:10, zidong <> 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_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;

Tricky, Oct 5, 2010

3. ### AndyGuest

I think it is a very nice question.

Andy

Andy, Oct 5, 2010
4. ### KJGuest

On Oct 5, 9:30 am, Andy <> 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

KJ, Oct 5, 2010
5. ### backhusGuest

On 5 Okt., 17:07, KJ <> wrote:
> On Oct 5, 9:30 am, Andy <> 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

backhus, Oct 8, 2010