File: logic_timing.dem

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,940 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (28 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
# Logic timing diagram constructed with hsteps
#
set title "Logic timing of bits in sequential ASCII characters"
set title font ":Bold"
set tmargin 4

set yrange [0:9]
set xrange [0.5:8]
unset border
unset tics
set ytics 1,1,8 scale 0 format "bit %.0g" offset 0,0.3
unset key

set style fill solid 0.2 border lc "black"

array DATA = [ 0x67, 0x6e, 0x75, 0x70, 0x6c, 0x6f, 0x74 ]
bit(i)  = (DATA[column(1)] >> (i-1)) & 0x1
char(i) = sprintf( "%c", DATA[i] )

plot for [k=1:8] \
        DATA using 1:(0.8 * bit(k)):(0.5) with hsteps offset k lw 2 fc black, \
     for [k=1:8] \
        DATA using 1:(k):(bit(k)?"1":"0") with labels offset 0,1 font ",9", \
     DATA using 1:(0.5):(char($1)) with labels font ",16" tc 'blue'

pause -1 "<cr> to continue"
reset