This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Functional Type Expressions of Sequential Circuits with the Notion of Referring Forms

Shunji Nishimura Department of Information Engineering
National Institute of Technology, Oita College
Oita, Japan
s-nishimura@oita-ct.ac.jp
Abstract

This paper introduces the notion of referring forms as a new metric for analyzing sequential circuits from a functional perspective. Sequential circuits are modeled as causal stream functions, the outputs of which depend solely on the past and current inputs. Referring forms are defined based on the type expressions of functions and represent how a circuit refers to past inputs. The key contribution of this study is identifying a universal property in multiple clock domain circuits using referring forms. This theoretical framework is expected to enhance the comprehension and analysis of sequential circuits.

Index Terms:
sequential circuit, stream function, causal function

I Introduction

The primary expectation of digital circuits is functionality. We are concerned with how the circuit produces output when a sequential series of input values is provided, from an external perspective. Although the internal structure of a circuit that realizes this functionality is important, it can be considered as secondary. Further theoretical studies on the functionality of these circuits are warranted. We discuss digital circuits from a theoretical and functional perspective, without focusing on practical issues such as circuit design for a particular application. In this study, sequential circuits are viewed as causal functions, the outputs of which depend solely on past and current inputs and not on future inputs. We adopt type expressions to investigate these functions.

A previous study [1] adopted a similar approach, but with three profound differences. (1) Regarding background time, the previous study allowed an arbitrary partially ordered set as time, whereas this study considers stream functions; that is, only natural (ordinal) numbers are regarded as time, and this difference simplifies type expressions. (2) This study proposes the notion of referring forms, which appeared only implicitly in the previous paper. (3) The notion of time preservation was also proposed in the previous study, and multiple clock domain circuits were classified as time preserving without proof. In this study, the proof is provided.

The contribution of this work is that it proposes a new metric to investigate sequential circuits, namely referring forms, accompanied by the revelation of a universal property of multiple clock domain circuits. We expect that these results will enhance the understanding of sequential circuits.

II Preliminaries

II-A Types of Causal Stream Functions

From a theoretical perspective, sequential circuits are described using Mealy machines (or Mealy automata) [2, 3]. For arbitrary sets II and OO, a Mealy machine (S,ψ)(S,\psi) with input II and output OO consists of a set SS of states and transition function ψ:S(O×S)I\psi:S\to(O\times S)^{I}. When a previous state sSs\in S and current input iIi\in I are provided, a tuple of the current output and state ψsiO×S\psi\,s\,i\in O\times S is derived. For a given initial state, the Mealy machine (S,ψ)(S,\psi) behaves as a causal stream function of type I1O1I^{\mathbb{N}_{1}}\to O^{\mathbb{N}_{1}}, where 1\mathbb{N}_{1} denotes the natural numbers {1,2,}\{1,2,\cdots\}, excluding zero, as ordinal numbers. (We also use 0\mathbb{N}_{0} for {0,1,}\{0,1,\cdots\} later.) Domain I1I^{\mathbb{N}_{1}} and codomain O1O^{\mathbb{N}_{1}} represent infinite input and output streams over time; that is, the input and output signals, respectively. Causal means that the current output depends only on past and current inputs and not on future inputs.

This function is constructed from the transition function ψ\psi of the Mealy machine, as follows: Given an initial state s0s_{0} and a finite input stream (i1,i2,,in)In(i_{1},i_{2},\cdots,i_{n})\in I^{n}, the output stream (o1,o2,,on)On(o_{1},o_{2},\cdots,o_{n})\in O^{n} is determined by (oj,sj)=ψsj1ij(j1)(o_{j},s_{j})=\psi\,s_{j-1}\,i_{j}\;(j\in\mathbb{N}_{1}). Conversely, [4] proved that an arbitrary causal stream function f:I1O1f:I^{\mathbb{N}_{1}}\to O^{\mathbb{N}_{1}} can be represented using the corresponding Mealy machine. Therefore, we investigate the causal stream functions I1O1I^{\mathbb{N}_{1}}\to O^{\mathbb{N}_{1}} instead of Mealy machines.

We consider a causal stream function f:I1O1f\,:\,I^{\mathbb{N}_{1}}\to O^{\mathbb{N}_{1}}. Because it is causal, the nn-th output ono_{n} depends on an nn-length input stream (i1,i2,,in)(i_{1},i_{2},\cdots,i_{n}), and ff can be expressed by a family of functions {fn:InO}n1\{\,f_{n}\,:\,I^{n}\to O\,\}_{n\in\mathbb{N}_{1}}. We denote this function family as

I+O\displaystyle I^{+}\to O (1)

to simplify the later expressions.

We must consider the product type of the input to develop our theory further. When the input II of the causal stream functions (1) is converted into the product IA×IBI_{A}\times I_{B}, it becomes (IA×IB)+IA+×IB+(I_{A}\times I_{B})^{+}\cong I_{A}^{\;+}\times I_{B}^{\;+} and the type is isomorphic to

IA+IB+O\displaystyle I_{A}^{\;+}\to I_{B}^{\;+}\to O (2)

by Currying. Note that the two pluses above must be interpreted as the same number; that is, {IAnIBnO}n1\{\,I_{A}^{\;\,n}\to I_{B}^{\;\,n}\to O\,\}_{n\in\mathbb{N}_{1}} in the expression of function families, which differs from the usual definition A+=A+(A×A)++AA^{+}=A+(A\times A)+\cdots+A^{\mathbb{N}}.

II-B Dependent Types

We also require notions of the dependent types [5, 6] for sets and elements instead of types and terms. For given ASetA\in Set and α:ASet\alpha:A\to Set, a subset (a:A)×αaA×xAαx(a:A)\times\alpha\,a\,\subset\,A\times{\displaystyle\sum_{x\in A}}\,\alpha\,x is defined as

(x,y)(a:A)×αaiffxAandyαx,\displaystyle(x,y)\in(a:A)\times\alpha\,a\enspace\;\text{iff}\;\enspace x\in A\;\text{and}\;y\in\alpha\,x, (3)

where (a:A)(a:A) represents a domain AA and an arbitrary aa is obtained from AA for later expressions. In this study, (a:A)(a:A) denotes a domain with dependent types, as explained above, and aAa\in A denotes the usual proposition.

III Referring Forms

III-A Definition

For functions with two-part inputs, such as (2), we introduce the notion that a given first input restricts the second input domain. To express this notion, we use dependent types and consider

f:(σ:C+)ϕσOϕ:C+𝒫(I+),\displaystyle\begin{gathered}f:(\sigma:C^{+})\to\phi\,\sigma\to O\\ \phi:C^{+}\to\mathcal{P}(I^{+}),\end{gathered} (6)

where 𝒫\mathcal{P} denotes the power sets. We use the control input CC and data input II instead of IAI_{A} and IBI_{B} in (2). The second domain of the upper expression in (6) is not the entire data input I+I^{+}, but only part of it, as if it were filtered based on the control input σ\sigma. For example, for given ϕn:Cn𝒫(In)\phi_{n}:C^{n}\to\mathcal{P}(I^{n}) and σn=(c1,c2,,cn)\sigma_{n}=(c_{1},c_{2},\cdots,c_{n}), ϕnσn:=I××I\phi_{n}\,\sigma_{n}:=I\times\cdots\times I means that fnσnf_{n}\,\sigma_{n} can refer to all past inputs, whereas ϕnσn:=×××I\phi_{n}\,\sigma_{n}:=\emptyset\times\cdots\times\emptyset\times I means that fnσnf_{n}\,\sigma_{n} can refer to the current input only. In addition, we assume that a given first value σ:C+\sigma:C^{+} of ff does not influence the final function ϕσO\phi\,\sigma\to O; that is, ϕσ=ϕσ\phi\,\sigma=\phi\,\sigma^{\prime} implies fσ=fσf\,\sigma=f\,\sigma^{\prime}.

Our model can be made more precise by focusing on the first and final time steps. In the first time step, no past is referred to; thus, C+C^{+} must be modified to CC^{*}. In the final time step, the current input is always referred to, because we consider Mealy machines. Finally, we obtain the following definition, originally proposed in [1]:

Definition 1.

(Domain restriction.) For given control input CC and data input II, Mealy machines as causal stream functions with domain restrictions, as follows:

f:(σ:C)ϕσ×IOϕ:C𝒫(I),\displaystyle\begin{gathered}f:(\sigma:C^{*})\to\phi\,\sigma\times I\to O\\ \phi:C^{*}\to\mathcal{P}(I^{*}),\end{gathered} (9)

and ϕ\phi is known as a restriction map.

The current input II is always provided, and the restriction map ϕ\phi considers only past inputs and not current inputs. A restriction map ϕ\phi comprehends how the circuit refers to the past with the passage of time.

The notion of domain restriction (9) contains the control signal σC\sigma\in C^{*}; however, to study the reference method, we only require the image ϕσ\phi\,\sigma. We omit the control signal σ\sigma from the expression of the domain restriction (9), which helps us to observe how the circuit refers to past inputs easily.

Definition 2.

(Referring forms.) For a causal stream function that can be expressed as

(ρ:𝒫(I))ρ×IO,\displaystyle(\rho:\mathcal{P}(I^{*}))\to\rho\times I\to O, (10)

ρ\rho is the referring form.

Roughly, referring forms represent a memory element of the target circuit and a given control signal to the memory element; they provide the manner in which the circuit refers to past inputs. When (10) is precisely expressed as a family of functions,

{(ρ:𝒫(In))ρ×IO}n𝟘,\displaystyle\{(\rho:\mathcal{P}(I^{n}))\to\rho\times I\to O\}_{n\in\mathbb{N_{0}}}, (11)

and the referring form is {ρn:𝒫(In)}n0\{\rho_{n}:\mathcal{P}(I^{n})\}_{n\in\mathbb{N}_{0}}. The set {ρn}n0\{\rho_{n}\}_{n\in\mathbb{N}_{0}} can be regarded as ρ:(n:0)𝒫(In)\rho:(n:\mathbb{N}_{0})\to\mathcal{P}(I^{n}) and approximately ρ:0𝒫(I0)\rho:\mathbb{N}_{0}\to\mathcal{P}(I^{\mathbb{N}_{0}}).

III-B Examples

Refer to caption
Figure 1: Referring form of D-FF.
Refer to caption
Figure 3: Multiple clock domain circuits.

We present an example of referring forms for a D-flip-flop (D-FF) as a sequential circuit, with data input II, output OO, and a clock. Because the D-FF holds the input value at the latest edge of the clock, the referring form ρ\rho behaves as shown in Fig. 3; during time n,,n+3n,\cdots,n+3, ρ\rho provides the input value at nn, following which ρ\rho provides the input value at n+4n+4. An excerpt from the overall type expressions is as follows:

××I\displaystyle\cdots\times\emptyset\times I\enspace\enspace\enspace\, (×I)O(atn+1)\displaystyle\,\qquad\quad(\times I)\to O\;(\text{at}\,n+1)
××I×\displaystyle\cdots\times\emptyset\times I\times\emptyset (×I)O(atn+2)\displaystyle\qquad\quad\;(\times I)\to O\;(\text{at}\,n+2)
××I×\displaystyle\cdots\times\emptyset\times I\times\emptyset ×(×I)O(atn+3),\displaystyle\times\emptyset\quad\;\;(\times I)\to O\;(\text{at}\,n+3),

where (×I)(\times I) means that the current input is not referred to by the D-FF. Note that the referring form shown in Fig. 3 is regarded as 𝒫(I)\mathcal{P}(I)^{*} because 𝒫(I)𝒫(I)\mathcal{P}(I)^{*}\cong\mathcal{P}(I^{*}) and may be intuitively comprehensible. Henceforth, this isomorphism is sometimes used implicitly.

Owing to the abstractness of types, we can express a class of circuits such as synchronous circuits, as shown in Fig. LABEL:fig:Sync(a), in an expression; the referring form is shown in (b). The input II is held and can be referred to at every edge of the clock. Unlike D-FFs, synchronous circuits can potentially refer to all past inputs at the clock edges through their feedback loop.

Next, we consider multiple clock domain circuits, as shown in Fig. 3. With the general description, their referring form becomes the same that of as Fig. LABEL:fig:Sync(b) for synchronous circuits because every FF may hold data from the input II and outputs from all of the FFs. In fact, when multiple clock domains are required, multiple parts should independently have different clock domains; for instance, Fig. LABEL:fig:2CDin(a) has clock1clock1 to latch input II, followed by the general clock2clock2 domain circuit. The referring form in Fig. LABEL:fig:2CDin(b) indicates that the latest input II latched by clock1clock1 is delivered to the clock2clock2 domain when clock2clock2 ticks.

IV Time Preservation

In the previous section, each referring form was studied individually. In this section, we investigate the universal properties of a set of referring forms representing a particular circuit. For a set of referring forms RR, each referring form ρR\rho\in R is ρ:0𝒫(I0)\rho:\mathbb{N}_{0}\to\mathcal{P}(I^{\mathbb{N}_{0}}), and we denote the unified image ρRρ(0)\bigcup\limits_{\rho\in R}\rho(\mathbb{N}_{0}) as R(0)R(\mathbb{N}_{0}). As 0\mathbb{N}_{0} has an order, we can consider whether the unified image has an order preserved by each ρR\rho\in R.

Definition 3.

(Time preservation.) A set of referring forms RR is time preserving when image R(0)R(\mathbb{N}_{0}) has a partial order and each ρR\rho\in R becomes order preserving.

Time preservation can be interpreted as the image R(0)R(\mathbb{N}_{0}) that maintains the concept of time in the original environment.

We focus on multiple clock domain circuits, as shown in Fig. 3, and study their referring forms in detail. To generate the output OmO_{m} at m0m\in\mathbb{N}_{0}, the circuits can refer to the previous input Im1I_{m-1} if it has been latched by some FFs, as well as to the earlier input Im2I_{m-2} if it has been latched at m2m-2 and held at m1m-1. This approach can be described using a pseudo-directed graph, as shown in Fig. 10(a), which allows us to determine which inputs can be referred to each output by tracking arrows. The nodes FFi(i=1,,n)FF_{i}(i=1,\cdots,n) represent D-FFs, which connect only one of their two input arrows to the output arrow depending on their attribute latch or hold, as with a multiplexer. The circular nodes represent combinational circuits, and in this context, we consider their connections rather than their logic. When we consider these nodes as all input arrows connected to all output arrows, the subject circuits become abstract multiple clock domain circuits. However, when we consider that these nodes are one of every possible input-output connection, this corresponds to considering arbitrary circuits in the form of Fig. 3, and we take the latter stance. Thus, the pseudo-graph in Fig. 10(a) describes referring forms of multiple clock domain circuits (Fig. 3).

Refer to caption
Figure 6: Pseudo-graph for referring forms of multiple clock domain circuits (Fig. 3).
Refer to caption
Figure 7: Pseudo-graph to prove the theory.
Lemma.

Let ρ\rho be a referring form of multiple clock domain circuits. If ρm1\rho_{m_{1}} contains II at l1l_{1}, for an arbitrary m2m1m_{2}\geq m_{1}, there exists l2l1l_{2}\geq l_{1} and ρm2\rho_{m_{2}} contains II at l2l_{2}.

Proof.

We can prove this by contradiction. Assume that (ρm2)l1,,(ρm2)m2(\rho_{m_{2}})_{l_{1}},\cdots,(\rho_{m_{2}})_{m_{2}} are \emptyset. According to (ρm1)l1=I(\rho_{m_{1}})_{l_{1}}=I, we assume that the path on the left side in Fig. 10(a), in which Il1I_{l_{1}} is connected to Om1O_{m_{1}} through FFa1,,FFakFF_{a_{1}},\cdots,FF_{a_{k}}, which we name an “earlier path.” Subsequently, we focus on the path towards Om2O_{m_{2}} as the right-hand side path in Fig. 10(a), and we observe that the latest FF FFakFF_{a_{k}} is connected to Om2O_{m_{2}} via the combination node because of the assumption. If the attributes of FFakFF_{a_{k}} are all held after the earlier path, the path towards Om2O_{m_{2}} is connected to the earlier path and (ρm2)l1(\rho_{m_{2}})_{l1} becomes II; thus, a latch attribute exists at some point. Next, FFak1FF_{a_{k-1}} is connected to FFakFF_{a_{k}} and we replicate the same argument. Finally, FFa1FF_{a_{1}} is connected to input II at some point after l1l_{1}, which contradicts this assumption. ∎

We can now state the theorem of a universal property for multiple clock domain circuits.

Theorem.

The referring forms for multiple clock domain circuits (as shown in Fig. 3) are time preserving.

Proof.

Let RR be the set of referring forms. We aim to define the order on R(0)R(\mathbb{N}_{0}) as the order derived by each ρR\rho\in R, but we must confirm its well-definedness by contradiction. Assuming that antisymmetry does not hold, we have ρ,ρR\rho,\rho^{\prime}\in R and m1,m2,l1,l20m_{1},m_{2},l_{1},l_{2}\in\mathbb{N}_{0} s.t.

m1m2,l1l2,ρm1=ρl2,ρm2=ρl1,ρm1ρm2.m_{1}\leq m_{2},\;l_{1}\leq l_{2},\;\rho_{m_{1}}=\rho^{\prime}_{l_{2}},\;\rho_{m_{2}}=\rho^{\prime}_{l_{1}},\;\rho_{m_{1}}\neq\rho_{m_{2}}.

Focusing on the latest II appearance in ρm1\rho_{m_{1}}, according to the Lemma, II appears later in ρm2\rho_{m_{2}}. As ρm2=ρl1\rho_{m_{2}}=\rho^{\prime}_{l_{1}}, another later II appears in ρl2\rho^{\prime}_{l_{2}}, and from ρl2=ρm1\rho^{\prime}_{l_{2}}=\rho_{m_{1}}, those II appearances occur at the same time. For the second-latest II appearance, we can reprise the same argument, and finally, we obtain ρm1=ρm2\rho_{m_{1}}=\rho_{m_{2}}, which contradicts the assumption. ∎

Finally, we present a non-time-preserving example. Fig. LABEL:fig:2mem(a) is a circuit with two data inputs I1I_{1} and I2I_{2}, three control inputs clock1,clock2clock1,clock2, and selsel, and two memories that can be read selectively. Two referring forms, ρ\rho and ρ\rho^{\prime}, are shown in Fig. LABEL:fig:2mem(b) and (c), respectively, and assuming that both undescribed pasts are the same, we cannot provide the order between ρn=ρn+7\rho_{n}=\rho^{\prime}_{n+7} and ρn+3=ρn+3\rho_{n+3}=\rho^{\prime}_{n+3} on the united image of the referring forms.

V Conclusion

We have introduced referring forms as a novel approach for investigating the functional properties of sequential circuits. Referring forms capture the transition behavior of circuits, specifically how past inputs are used to generate current outputs. We defined the concept of time preservation for referring forms and demonstrated that multiple clock domain circuits exhibit this property. This study provides a behavioral perspective on sequential circuits and offers new insights into their analysis and design. We hope that future research will explore further theoretical developments and practical applications of referring forms in digital circuits.

References

  • [1] S. Nishimura, “Classification of sequential circuits as causal functions,” in Journal of Physics: Conference Series (6th International Conference on Circuits, Systems and Simulation), vol. 2613, 2023, p. 012016.
  • [2] G. H. Mealy, “A method for synthesizing sequential circuits,” The Bell System Technical Journal, vol. 34, no. 5, pp. 1045–1079, 1955.
  • [3] M. Holcombe and W. M. L. Holcombe, Algebraic automata theory.   Cambridge University Press, 2004, no. 1.
  • [4] J. J. Rutten, “Algebraic specification and coalgebraic synthesis of mealy automata,” Electronic Notes in Theoretical Computer Science, vol. 160, pp. 305–319, 2006.
  • [5] P. Martin-Löf, “An intuitionistic theory of types: Predicative part,” in Studies in Logic and the Foundations of Mathematics.   Elsevier, 1975, vol. 80, pp. 73–118.
  • [6] A. Chlipala, Certified programming with dependent types: a pragmatic introduction to the Coq proof assistant.   MIT Press, 2022.