亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bcd_to_binary.v

?? ALTERA NIOS處理器實驗
?? V
字號:
//---------------------------------------------------------------------------
// BCD to binary converter, serial implementation, 1 clock per input bit.
//
//
// Description: See description below (which suffices for IP core
//                                     specification document.)
//
// Copyright (C) 2002 John Clayton and OPENCORES.ORG (this Verilog version)
//
// This source file may be used and distributed without restriction provided
// that this copyright statement is not removed from the file and that any
// derivative work contains the original copyright notice and the associated
// disclaimer.
//
// This source file is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation;  either version 2.1 of the License, or
// (at your option) any later version.
//
// This source is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
// License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this source.
// If not, download it from http://www.opencores.org/lgpl.shtml
//
//-----------------------------------------------------------------------------
//
// Author: John Clayton
// Date  : Nov. 24, 2003
// Update: Nov. 24, 2003  Copied this file from "binary_to_bcd.v" and
//                        modified it.
// Update: Nov. 25, 2003  Tested this module.  It works!
// Update: Nov. 25, 2003  Changed bit_counter and related logic so that long
//                        start pulses produce correct results at the end of
//                        the pulse.
//
//-----------------------------------------------------------------------------
// Description:
//
// This module takes a BCD input, and converts it into binary output, with each
// binary coded decimal input digit (of course) occupying 4-bits.
// The user can specify the number of input digits separately from the number
// of output bits.  Be sure that you have specified enough output bits to
// represent the largest input number you expect to convert, or else the
// most significant portion of the BCD input will never be processed.
// This module processes the BCD digits starting with the least significant
// and working its way through to the more significant digits, until the binary
// output register is "fully stuffed" with output bits.
// This means that a particular BCD input digit might only be processed half
// way!
// Also, there is no checking for invalid BCD digit contents...  Behavior is
// undefined for "BCD" input values outside the range [0..9], although it would
// be very easy to add error checking with an error indicator output bit.
//
//-----------------------------------------------------------------------------


module bcd_to_binary (
  clk_i,
  ce_i,
  rst_i,
  start_i,
  dat_bcd_i,
  dat_binary_o,
  done_o
  );
parameter BCD_DIGITS_IN_PP   = 5;  // # of digits of BCD input
parameter BITS_OUT_PP        = 16; // # of bits of binary output
parameter BIT_COUNT_WIDTH_PP = 4;  // Width of bit counter

// I/O declarations
input  clk_i;                      // clock signal
input  ce_i;                       // clock enable input
input  rst_i;                      // synchronous reset
input  start_i;                    // initiates a conversion
input  [4*BCD_DIGITS_IN_PP-1:0] dat_bcd_i;  // input bus
output [BITS_OUT_PP-1:0] dat_binary_o;      // output bus
output done_o;                     // indicates conversion is done

reg [BITS_OUT_PP-1:0] dat_binary_o;

// Internal signal declarations

reg  [BITS_OUT_PP-1:0] bin_reg;
reg  [4*BCD_DIGITS_IN_PP-1:0] bcd_reg;
wire [BITS_OUT_PP-1:0] bin_next;
reg  [4*BCD_DIGITS_IN_PP-1:0] bcd_next;
reg  busy_bit;
reg  [BIT_COUNT_WIDTH_PP-1:0] bit_count;
wire bit_count_done;

//--------------------------------------------------------------------------
// Functions & Tasks
//--------------------------------------------------------------------------

function [4*BCD_DIGITS_IN_PP-1:0] bcd_asr;
  input [4*BCD_DIGITS_IN_PP-1:0] din;
  integer k;
  reg cin;
  reg [3:0] digit;
  reg [3:0] digit_more;

  begin
    cin = 1'b0;
    for (k=BCD_DIGITS_IN_PP-1; k>=0; k=k-1) // From MS digit to LS digit
    begin
      digit[3] = 1'b0;
      digit[2] = din[4*k+3];
      digit[1] = din[4*k+2];
      digit[0] = din[4*k+1];
      digit_more = digit + 5;
      if (cin)
      begin
        bcd_asr[4*k+3] = digit_more[3];
        bcd_asr[4*k+2] = digit_more[2];
        bcd_asr[4*k+1] = digit_more[1];
        bcd_asr[4*k+0] = digit_more[0];
      end
      else
      begin
        bcd_asr[4*k+3] = digit[3];
        bcd_asr[4*k+2] = digit[2];
        bcd_asr[4*k+1] = digit[1];
        bcd_asr[4*k+0] = digit[0];
      end
      cin = din[4*k+0];
    end  // end of for loop
  end

endfunction

//--------------------------------------------------------------------------
// Module code
//--------------------------------------------------------------------------

// Perform proper shifting, binary ASL and BCD ASL
assign bin_next = {bcd_reg[0],bin_reg[BITS_OUT_PP-1:1]};
always @(bcd_reg)
begin
  bcd_next <= bcd_asr(bcd_reg);
//  bcd_next <= bcd_reg >> 1;  Just for testing...
end

// Busy bit, input and output registers
always @(posedge clk_i)
begin
  if (rst_i)
  begin
    busy_bit <= 0;  // Synchronous reset
    dat_binary_o <= 0;
  end
  else if (start_i && ~busy_bit)
  begin
    busy_bit <= 1;
    bcd_reg <= dat_bcd_i;
    bin_reg <= 0;
  end
  else if (busy_bit && ce_i && bit_count_done && ~start_i)
  begin
    busy_bit <= 0;
    dat_binary_o <= bin_next;
  end
  else if (busy_bit && ce_i & ~bit_count_done)
  begin
    bin_reg <= bin_next;
    bcd_reg <= bcd_next;
  end
end
assign done_o = ~busy_bit;

// Bit counter
always @(posedge clk_i)
begin
  if (~busy_bit) bit_count <= 0;
  else if (ce_i && ~bit_count_done) bit_count <= bit_count + 1;
end
assign bit_count_done = (bit_count == (BITS_OUT_PP-1));

endmodule

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美色老头old∨ideo| 欧美区在线观看| 99这里只有久久精品视频| 不卡av电影在线播放| 成人综合婷婷国产精品久久| 国产激情一区二区三区桃花岛亚洲| 一区二区三区精品在线观看| 久久久九九九九| 亚洲少妇最新在线视频| 亚洲电影欧美电影有声小说| 日韩精品国产精品| 麻豆freexxxx性91精品| 国产成a人亚洲精| 在线视频你懂得一区| 欧美日韩成人一区二区| 精品美女一区二区| 国产精品乱人伦| 亚洲一区二区高清| 午夜精品爽啪视频| 国产精品影视在线观看| av一本久道久久综合久久鬼色| 欧美日韩在线亚洲一区蜜芽| 亚洲美女屁股眼交| 免费观看一级欧美片| 成人的网站免费观看| 欧美日本一区二区三区| 国产日韩欧美精品综合| 亚洲va欧美va人人爽| 国产91精品一区二区| 4438x成人网最大色成网站| 亚洲图片激情小说| 另类小说色综合网站| 色综合夜色一区| 久久毛片高清国产| 亚洲v中文字幕| 日本国产一区二区| 亚洲蜜臀av乱码久久精品蜜桃| 午夜私人影院久久久久| 国产精华液一区二区三区| 精品日韩一区二区三区免费视频| 亚洲成人自拍网| 成人听书哪个软件好| 欧美精品一区在线观看| 亚洲大片在线观看| 欧美撒尿777hd撒尿| 中文字幕乱码日本亚洲一区二区| 午夜欧美大尺度福利影院在线看| 麻豆久久久久久| 欧美va天堂va视频va在线| 老司机一区二区| 久久综合狠狠综合| 精品一区二区三区免费| 欧美精品一区二区久久久| 国产一区二区三区视频在线播放| 精品国产乱码久久久久久老虎| 日本成人中文字幕| 久久久亚洲精华液精华液精华液| 一区二区在线免费| 在线播放中文字幕一区| 99免费精品在线观看| 国产精品久久久久久久第一福利 | 亚洲一区二区三区美女| 精品久久一区二区| 国内国产精品久久| 亚洲国产另类av| 欧美久久久久久蜜桃| 婷婷久久综合九色综合绿巨人| 欧美日韩免费高清一区色橹橹| 日韩精品一二区| 精品国产乱码久久久久久1区2区| 国产精品主播直播| 亚洲尤物视频在线| 欧美不卡123| 91亚洲男人天堂| 久久99久久久久| 亚洲精品视频一区二区| 精品国产麻豆免费人成网站| 欧美日韩国产综合视频在线观看 | 免费人成精品欧美精品| 国产亚洲一区二区三区| 欧美性色黄大片手机版| 福利一区二区在线| 亚洲成av人影院在线观看网| 美女免费视频一区| 国产欧美日韩在线| 日韩一级大片在线| 欧美色网站导航| 成年人国产精品| 国产精品综合一区二区| 午夜国产精品影院在线观看| 中文字幕不卡的av| 精品久久久久久久久久久院品网 | 在线欧美日韩精品| 成人动漫精品一区二区| 久久国产婷婷国产香蕉| 亚洲一区二区欧美| 亚洲影院久久精品| 国产精品嫩草影院com| 欧美国产成人精品| 欧美成人官网二区| 欧美一区二区三区视频免费| 欧美日韩视频在线观看一区二区三区 | 欧美日韩综合在线| 6080亚洲精品一区二区| 99re在线视频这里只有精品| 国产成人小视频| 国产精品18久久久久久vr| 国产美女在线观看一区| 国产精品77777竹菊影视小说| 国内精品免费在线观看| 久久av资源站| 国产成人aaa| 99久久亚洲一区二区三区青草| 99久久国产综合精品女不卡| 色又黄又爽网站www久久| 欧美日韩国产精品成人| 在线精品视频一区二区| 欧美性色综合网| 日韩欧美一级在线播放| 久久午夜老司机| 亚洲天堂福利av| 日韩成人免费看| 一区二区三区国产豹纹内裤在线| 一区二区三区四区不卡视频| 一区二区三区在线高清| 久久精品国产一区二区三区免费看| 国产乱码精品一区二区三| av激情成人网| 日韩欧美一区电影| 一区二区三区四区高清精品免费观看| 日日夜夜免费精品视频| 国产精品一区二区三区99| 色网综合在线观看| 久久色成人在线| 亚洲午夜视频在线观看| 国产精一品亚洲二区在线视频| 欧美少妇bbb| 中文字幕av一区二区三区| 亚洲最快最全在线视频| 国产成人午夜高潮毛片| 日韩一区二区三区视频在线| 国产精品激情偷乱一区二区∴| 久久99热99| 日韩一级在线观看| 亚洲成人久久影院| 99综合电影在线视频| 久久女同性恋中文字幕| 亚洲.国产.中文慕字在线| 色综合久久久网| 中文字幕一区二区三| 波波电影院一区二区三区| 精品国产一区二区三区av性色| 五月婷婷久久丁香| 99精品视频免费在线观看| 国产欧美日本一区视频| 精品一区二区在线免费观看| 7777精品伊人久久久大香线蕉超级流畅| 亚洲色图视频网| 色久综合一二码| 亚洲在线一区二区三区| 一本大道av伊人久久综合| 中文字幕一区三区| av成人老司机| 亚洲成人黄色影院| 欧美一区二区在线免费观看| 裸体健美xxxx欧美裸体表演| 亚洲综合激情另类小说区| 懂色av中文字幕一区二区三区 | 国产河南妇女毛片精品久久久 | 欧美一级在线免费| 国产乱妇无码大片在线观看| 亚洲精品ww久久久久久p站| 日韩一区二区免费视频| 成人美女视频在线看| 亚洲国产色一区| 久久精品免视看| 在线成人av网站| av影院午夜一区| 毛片av一区二区三区| 国内精品视频666| 一色桃子久久精品亚洲| 日韩视频免费观看高清完整版| aaa亚洲精品一二三区| 久久99精品国产| 午夜精品一区二区三区三上悠亚| 欧美国产欧美综合| 精品理论电影在线| 欧美一区二区三区在线| 欧美专区日韩专区| 99久久精品国产一区二区三区| 免费久久99精品国产| 亚洲午夜久久久久久久久久久| 国产精品女同一区二区三区| 久久久亚洲国产美女国产盗摄 | 久久精品日韩一区二区三区| 91精品啪在线观看国产60岁| 欧亚洲嫩模精品一区三区| 成人国产视频在线观看| 盗摄精品av一区二区三区| 国产一区二区三区四区五区美女 |