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

Subversion Repositories i650

[/] [i650/] [trunk/] [rtl/] [zero_check.v] - Blame information for rev 24

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

Line No. Rev Author Line
1 23 eightycc
`timescale 1ns / 1ps
2
//////////////////////////////////////////////////////////////////////////////////
3
// IBM 650 Reconstruction in Verilog (i650)
4
// 
5
// This file is part of the IBM 650 Reconstruction in Verilog (i650) project
6
// http:////www.opencores.org/project,i650
7
//
8
// Description: Accumulator zero check.
9
// 
10
// Additional Comments: See US 2959351, Fig. 84.
11
//
12
// Copyright (c) 2015 Robert Abeles
13
//
14
// This source file is free software; you can redistribute it
15
// and/or modify it under the terms of the GNU Lesser General
16
// Public License as published by the Free Software Foundation;
17
// either version 2.1 of the License, or (at your option) any
18
// later version.
19
//
20
// This source is distributed in the hope that it will be
21
// useful, but WITHOUT ANY WARRANTY; without even the implied
22
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
23
// PURPOSE.  See the GNU Lesser General Public License for more
24
// details.
25
//
26
// You should have received a copy of the GNU Lesser General
27
// Public License along with this source; if not, download it
28
// from http://www.opencores.org/lgpl.shtml
29
//////////////////////////////////////////////////////////////////////////////////
30
`include "defines.v"
31
 
32
module zero_check (
33
    input rst,
34
    input bp,
35
    input d0, d1_dx,
36
    input wu,
37
    input acc_no_zero,
38
 
39
    output acc_no_zero_test, acc_zero_test
40
    );
41
 
42
   reg no_zero_latch, no_zero_check_latch;
43
   assign acc_no_zero_test = no_zero_latch & no_zero_check_latch;
44
   assign acc_zero_test = ~no_zero_latch & ~no_zero_check_latch;
45
 
46
   always @(posedge bp)
47
      if (rst) begin
48
         no_zero_latch <= 0;
49
         no_zero_check_latch <= 0;
50
      end else if (wu & d0) begin
51
         no_zero_latch <= 0;
52
         no_zero_check_latch <= 0;
53
      end else if (acc_no_zero & d1_dx) begin
54
         no_zero_latch <= 1;
55
         no_zero_check_latch <= 1;
56
      end;
57
 
58
endmodule

powered by: WebSVN 2.1.0

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