Demonstration of timing.sty, a convenient set of macros for drawing logic timing diagrams. Written by Pascal Wolkotte and Jochem Rutgers.
The macros are also available as a separate sty file:

Edit and compile if you like:
% Some macros for logic timing diagrams.%% Author: ir. Pascal T. Wolkotte and Jochem Rutgers, University of Twente\documentclass{article}% Start of timing.sty% Some macros for logic timing diagrams.%% Author: ir. Pascal T. Wolkotte and Jochem Rutgers, University of Twente% Version: 0.1% Date: 2007/10/11\usepackage{tikz}\newcounter{wavenum}\setlength{\unitlength}{1cm}% advance clock one cycle, not to be called directly\newcommand*{\clki}{\draw (t_cur) -- ++(0,.3) -- ++(.5,0) -- ++(0,-.6) -- ++(.5,0) -- ++(0,.3)node[time] (t_cur) {};}\newcommand*{\bitvector}[3]{\draw[fill=#3] (t_cur) -- ++( .1, .3) -- ++(#2-.2,0) -- ++(.1, -.3)-- ++(-.1,-.3) -- ++(.2-#2,0) -- cycle;\path (t_cur) -- node[anchor=mid] {#1} ++(#2,0) node[time] (t_cur) {};}% \known{val}{length}\newcommand*{\known}[2]{\bitvector{#1}{#2}{white}}% \unknown{length}\newcommand*{\unknown}[2][XXX]{\bitvector{#1}{#2}{black!20}}
Click to download: timing-diagram.tex • timing-diagram.pdf
Open in Overleaf: timing-diagram.tex