English 中文(简体)
在VHDL,将时间模式从12人改为24人
原标题:Changing time mode in a Digital Clock from 12HR to 24HR in VHDL

每个人。

I am designing a digital clock in VHDL which I am supposed to synthesize on a FPGA . I am cascading S1,S2,M1,M2,H1 and H2 where (S1 = second 1, M1 = Minute 1, H1 = hour 1 etc.). One of the requirements is for the clock to switch between 24HR display to a 12HR display format. How do I do it given that H1 and H2 are represented by 4 bits each i.e. 8 bits in total to display the current hour. Will I need to concatenate HR1 and HR2 and then subtract 12 and then de-concatenate it again? keep in mind that X mod 12 is not a synthesizable operation for implementation in FPGA.

非常感谢。

问题回答

基本上,你在双字母缩略语中做了全部算术。 因此,仅建造一个BCD比较器/分机:

if h1 = 1 and h2 > 2
  subtract 1 off h1
  subtract 2 off h2
  if h2 wrapped
     subtract 1 off h1

不需要 mo!

如果你有其他资源,你可以把H类登记册增加一倍。 让我们把H24-1和H24-2(如你已经做的那样)以及H12-1和H12-2“mod12”登记在旁。 两把奶制品都将被锁定,因此,每24小时都有两种格式。 有色人只是利用一些未爆炸弹药来交换其中一部分。





相关问题
Having many stacks with different types

I m making a C program that needs to use two stacks. One needs to hold chars, the other needs to hold doubles. I have two structs, node and stack: struct node { double value; struct node *...

Creating (boxed) primitive instance when the class is known

I need a method that returns an instance of the supplied class type. Let s assume that the supplied types are limited to such that an "empty" instance of them can be created. For instance, supplying ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

How to generate an instance of an unknown type at runtime?

i ve got the following in C#: string typename = "System.Int32"; string value = "4"; theses two strings should be taken to generate an object of the specified type with the specified value... result ...

Type reference scope

I m studying databases and am currently working on a object-relational DB project and I ve encountered a small problem with the number of possible constraints in an object table. I m using "Database ...

热门标签