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

Subversion Repositories y80e

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

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

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

powered by: WebSVN 2.1.0

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