Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- usepackage[vlined,linesnumbered]{algorithm2e} % Algorithm
- usepackage{algorithmic}
- usepackage{algorithm}
- usepackage{algcompatible}
- begin{figure}[h]
- small
- hrule
- vspace{2mm}
- textbf{Reader Operation}
- %vspace{1mm}
- begin{algorithmic}[1]
- STATE $ws = 1$
- STATE FQwT([textquoteleft 0'],$ws$); FQwT([textquoteleft 1'],$ws$)
- STATE function $FQwT$(char [] $query,$ int $ws$)
- STATE $k = ID.length$
- STATE $L = query.length$
- STATE $c_g=k-L$
- STATE $s=log2(ws)$
- STATE broadcast([$query], s$)
- STATE $[winMatch,crcCheck] = $receiveResponses()
- IF{$nSuccess=0$}
- STATE{$Phase1$}
- IF{$isempty$($winMatch$)}
- STATE $nIdles ++$
- ELSE [$crcCheck = 0$]
- STATE $nCollisions ++$
- IF{$ws=1$}
- STATE $Store$ $c_g$ $with$ $query$ $into$ $LIFO$ $(c_g=k-L)$
- STATE $FQwT$([$query$, textquoteleft 0'],$ws$); FQwT([$query$, textquoteleft 1'],$ws$)
- ELSE
- STATE $ws = 1$
- STATE $FQwT$ ([$query$],$ws$); FQwT([$query$],$ws$)
- ENDIF
- ELSE [$crcCheck=1$]
- IF{$L + ws < k$}
- STATE $nGoons ++$
- STATE $ws=ws ++$
- STATE FQwT($[query,winMatch],ws$)
- ELSE [$L + ws = k$]
- STATE $ws=1$
- STATE $nSuccess ++$
- ENDIF
- ENDIF
- ELSE
- STATE{$Phase2$}
- IF{isempty($winMatch$)}
- STATE $nIdles ++$
- ELSE[$crcCheck = 0$]
- STATE $nCollisions ++$
- STATE FQwT([$query$, textquoteleft 0'],$ws$); FQwT([$query$, textquoteleft 1'],$ws$)
- ELSE[$crcCheck = 1$]
- IF{$L + ws < k$}
- STATE $nGoons ++$
- STATE $ ws=f(c_g,L)$
- STATE $s= log2(ws)$
- STATE FQwT([$query$, $winMatch$],$ws$);
- ELSE[$L + ws = k$]
- STATE $nSuccess ++$
- ENDIF
- ENDIF
- ENDIF
- end{algorithmic}
- vspace{1mm}
- hrule
- vspace{2mm}
- textbf{Tag Operation}
- vspace{1mm}
- begin{algorithmic}[1]
- STATE $receive(query, s)$
- STATE $L = query.length$
- STATE $ws=2^s$
- IF{$query = ID[0:L-1]$}
- STATE $CRC=$ crc($ID[L:L{+}ws]$)
- STATE backscatter($ID[L:L{+}ws],CRC$)
- ENDIF
- end{algorithmic}
- vspace{1mm}
- hrule
- caption{Pseudo-code of FQwT.
- First, the operation of the reader is presented, then the tag operation.}
- label{Fig:dis53}
- end{figure}
Add Comment
Please, Sign In to add comment