OpenCores
URL https://opencores.org/ocsvn/y80e/y80e/trunk

Subversion Repositories y80e

[/] [y80e/] [trunk/] [rtl/] [alu_shft.v] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 bsa
/*******************************************************************************************/
2
/**                                                                                       **/
3
/** COPYRIGHT (C) 2011, SYSTEMYDE INTERNATIONAL CORPORATION, ALL RIGHTS RESERVED          **/
4
/**                                                                                       **/
5
/** alu shifter module                                                Rev 0.0  07/17/2011 **/
6
/**                                                                                       **/
7
/*******************************************************************************************/
8
module alu_shft (shft_c, shft_out, alub_in, aluop_reg, carry_bit);
9
 
10
  input         carry_bit;     /* carry flag input                                         */
11
  input   [7:0] alub_in;       /* alu b input                                              */
12
  input  [`AOP_IDX:0] aluop_reg;   /* alu operation control subset                         */
13
  output        shft_c;        /* alu shifter carry output                                 */
14
  output  [7:0] shft_out;      /* alu shifter output                                       */
15
 
16
  /*****************************************************************************************/
17
  /*                                                                                       */
18
  /* signal declarations                                                                   */
19
  /*                                                                                       */
20
  /*****************************************************************************************/
21
  reg         shft_c;                                      /* shifter carry output         */
22
  reg   [7:0] shft_out;                                    /* shifter output               */
23
 
24
  /*****************************************************************************************/
25
  /*                                                                                       */
26
  /* alu shifter function                                                                  */
27
  /*                                                                                       */
28
  /*****************************************************************************************/
29
  always @ (aluop_reg or alub_in) begin
30
    casex (aluop_reg) //synopsys parallel_case
31
      `AOP_RL,
32
      `AOP_RLA:   shft_c = alub_in[7];
33
      `AOP_RLC,
34
      `AOP_RLCA:  shft_c = alub_in[7];
35
      `AOP_RR,
36
      `AOP_RRA:   shft_c = alub_in[0];
37
      `AOP_RRC,
38
      `AOP_RRCA:  shft_c = alub_in[0];
39
      `AOP_SLA:   shft_c = alub_in[7];
40
      `AOP_SRA:   shft_c = alub_in[0];
41
      `AOP_SRL:   shft_c = alub_in[0];
42
      default:    shft_c = 1'b0;
43
      endcase
44
    end
45
 
46
  always @ (aluop_reg or alub_in or carry_bit) begin
47
    casex (aluop_reg) //synopsys parallel_case
48
      `AOP_RL,
49
      `AOP_RLA:   shft_out = {alub_in[6:0], carry_bit};
50
      `AOP_RLC,
51
      `AOP_RLCA:  shft_out = {alub_in[6:0], alub_in[7]};
52
      `AOP_RR,
53
      `AOP_RRA:   shft_out = {carry_bit, alub_in[7:1]};
54
      `AOP_RRC,
55
      `AOP_RRCA:  shft_out = {alub_in[0], alub_in[7:1]};
56
      `AOP_SLA:   shft_out = {alub_in[6:0], 1'b0};
57
      `AOP_SRA:   shft_out = {alub_in[7], alub_in[7:1]};
58
      `AOP_SRL:   shft_out = {1'b0, alub_in[7:1]};
59
      default:    shft_out = 8'h00;
60
      endcase
61
    end
62
 
63
  endmodule
64
 
65
 
66
 
67
 
68
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.