Binary Counters Integer Representations towards Efficient Counting in the Bit Probe Model (presented at TAMC 2011) Gerth Stølting Brodal (Aarhus University)

Slides:



Advertisements
Similar presentations
Conversion and Coding (12)10.
Advertisements

General Sequential Design
Gerth Stølting Brodal University of Aarhus Monday June 9, 2008, IT University of Copenhagen, Denmark International PhD School in Algorithms for Advanced.
State-machine structure (Mealy)
The Binary Numbering Systems
Number Theory and Cryptography
Dynamic Planar Range Maxima Queries (presented at ICALP 2011) Gerth Stølting Brodal Aarhus University Kostas Tsakalidis University of Primorska, October.
Binary Counters Integer Representations towards Efficient Counting in the Bit Probe Model (paper presented at TAMC 2011) Gerth Stølting Brodal (Aarhus.
Dynamic Planar Range Maxima Queries (presented at ICALP 2011) Gerth Stølting Brodal Aarhus University Kostas Tsakalidis LIAFA, Université Paris Diderot,
RIPPLE COUNTERS A register that goes through a prescribed sequence of states upon the application of input pulses is called a counter. The input pulses.
Sequential Circuits Problems(II) Prof. Sin-Min Lee Department of Mathematics and Computer Science Algorithm = Logic + Control.
Assembly Language and Computer Architecture Using C++ and Java
Fully Persistent B-Trees 23 rd Annual ACM-SIAM Symposium on Discrete Algorithms, Kyoto, Japan, January 18, 2012 Gerth Stølting Brodal Konstantinos Tsakalidis.
Assembly Language and Computer Architecture Using C++ and Java
1 Section 2.5 Integers and Algorithms. 2 Euclidean algorithm for finding gcd Where L is a larger number, and S is a smaller number, to find gcd(L,S):
7/2/2015Errors1 Transmission errors are a way of life. In the digital world an error means that a bit value is flipped. An error can be isolated to a single.
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE20 Lecture 3 Number Systems: Negative Numbers 1.Sign and Magnitude Representation 2.1’s Complement Representation 3.2’s Complement Representation 1.
Number Systems and Codes Discussion D4.1. Number Systems Counting in Binary Positional Notation Hexadecimal Numbers Negative Numbers.
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 1 Overflow Signed binary is in fixed range -2 n-1  2 n-1 If the answer for addition/subtraction more than the.
Number System and Codes
9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU1 Codes.
3. Representing Integer Data
1.6 Signed Binary Numbers.
Designing Combinational Logic Circuits in Verilog - 2
Synchronous Counters ET 5. Thinking back In the past we have seen that asynchronous counters can be used to count binary in the order that we have filled.
1 Number SystemsLecture 8. 2 BINARY (BASE 2) numbers.
Strict Fibonacci Heaps Gerth Stølting Brodal Aarhus University George Lagogiannis Robert Endre Tarjan Agricultural University of Athens Princeton University.
Algorithms and Data Structures Gerth Stølting Brodal Computer Science Day, Department of Computer Science, Aarhus University, May 25, 2012.
Computer Architecture
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
Chapter 2 Number Systems + Codes. Overview Objective: To use positional number systems To convert decimals to binary integers To convert binary integers.
1 Problem Solving using computers Data.. Representation & storage Representation of Numeric data The Binary System.
Computer System Architecture © Korea Univ. of Tech. & Edu. Dept. of Info. & Comm. Chap. 2 Number Systems and Codes Binary to Decimal Conversions.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CompSci 102 Discrete Math for Computer Science February 16, 2012 Prof. Rodger.
1 EENG 2710 Chapter 1 Number Systems and Codes. 2 Chapter 1 Homework 1.1c, 1.2c, 1.3c, 1.4e, 1.5e, 1.6c, 1.7e, 1.8a, 1.9a, 1.10b, 1.13a, 1.19.
ECE 2110: Introduction to Digital Systems BCD, Gray, Character, Action/Event, Serial Data.
6 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
Chapter 2: The Logic of Compound Statements 2.5 Application: Number Systems and Circuits for Addition 1 Counting in binary is just like counting in decimal.
Integer Representations and Counting in the Bit Probe Model M. Zaiur Rahman and J. Ian Munro Cheriton School of Computer Science University of Waterloo.
Complexity 20-1 Complexity Andrei Bulatov Parallel Arithmetic.
Error Detection and Correction
Algorithms and Data Structures Gerth Stølting Brodal Computer Science Day, Department of Computer Science, Aarhus University, May 25, 2012.
1 Chapter 17: Amortized Analysis I. 2 About this lecture Given a data structure, amortized analysis studies in a sequence of operations, the average time.
Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
ERROR DETECTING AND CORRECTING CODES -BY R.W. HAMMING PRESENTED BY- BALAKRISHNA DHARMANA.
Signed Binary Numbers Arithmetic Subtraction – In 2’s-complement form: Example: 1.Take the 2’s complement of the subtrahend (including the sign bit) and.
Decade Counter (BCD Counter). Introduction A counter which is reset at the 10 th clock pulse is called decade counter. The decade counter is otherwise.
Lecture 3 Combinational Circuits
DIGITAL SYSTEMS Number systems & Arithmetic Rudolf Tracht and A.J. Han Vinck.
Counters.
Addition, Subtraction, Logic Operations and ALU Design
Optimal Planar Orthogonal Skyline Counting Queries Gerth Stølting Brodal and Kasper Green Larsen Aarhus University 14th Scandinavian Workshop on Algorithm.
1. Number Systems. Common Number Systems SystemBaseSymbols Used by humans? Used in computers? Decimal100, 1, … 9YesNo Binary20, 1NoYes Octal80, 1, … 7No.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
8085 Microprocessor Architecture
EKT 221 – Counters.
EKT 221 : Digital 2 COUNTERS.
COUNTING IN BINARY Binary weightings 0 x x x x 8
Chapter 1 Number Systems, Number Representations, and Codes
Arithmetic operations Programming
Strict Fibonacci Heaps
Topic 1: Data Representation
COUNTING IN BINARY Binary weightings 0 x x x x 8
Presentation transcript:

Binary Counters Integer Representations towards Efficient Counting in the Bit Probe Model (presented at TAMC 2011) Gerth Stølting Brodal (Aarhus University) Mark Greve (Aarhus University) Vineet Pandey (BITS Pilani, India) S. Srinivasa Rao (Seoul, South Korea) University of Ljubljana, October 12, 2011

0

1

10

11

100

101

110

111

1000

1001

1010

1011

1100

1101

1110

1111

we are counting modulo = 16 10

1011 1∙ ∙ ∙ ∙2 0 = =

DecimalBinary b3b2b1b0b3b2b1b0 b0b0 0 1 b1b1 b2b2 b3b Reads 4 bits Writes 4 bits DecimalBinary DecimalBinary Algorithm 20

DecimalBinaryReflected Gray code "To get the next code, for a code with even parity, flip the rightmost bit. For a code with odd parity, find the rightmost ‘1’ and flip the bit to its left. The only special case is when the last bit b n is the only ‘1’ in the code. This is also the last code in the sequence." DecimalBinaryReflected Gray code Always reads 4 bits Always writes 1 bit ---0 b0b0 b1b1 b2b b2b2 b2b2 b2b2 b1b b3b3 0 1 b3b3 b3b3 b3b3 b3b3 b3b3 b3b3 b3b3 b3b2b1b0b3b2b1b0 21

22

Question Does there exist a counter where one never needs to read all bits to increment the counter ? 23

Decimal Decimal Decimal b3b2b1b0b3b2b1b b0b0 b1b1 b1b b3b3 b3b3 b3b3 b2b2 0 1 Always reads 3 bits Always writes ≤ 2 bits [B., Greve, Pandey, Rao 2011] 24

y 3 y 2 y 1 y 0 x n-5 x n-6 ∙∙∙ x 2 x 1 x 0 Generalization to n bit counters Y 4 bits 3 reads 2 writes X n-4 bit Gray code n-4 reads 1 writes metode Increment(YX) inc(X) if (X == 0) inc(Y) Always reads n-1 bits Always writes ≤ 3 bits [B., Greve, Pandey, Rao 2011] 25 test needs to read all bits of X

Theorem 4-bit counter 3 reads and 2 writes n-bit counter n-1 reads and 3 writes Open problems n-1 reads and 2 writes, n>4? « n reads and writes ? [number of reads at least log 2 n] b0b0 b1b1 b1b b3b3 b3b3 b3b3 b2b2 0 1 n=5 ? ? bits read bits written 26

Redundant Counters Represent L different values using d > log L bits Efficiency E = L / 2 d 27

b n b n-1 ∙∙∙ b log n b log n-1 ∙∙∙b 0 Redundant counter with E = ½ (L = 2 n ) X L log n bits Gray code log n reads 1 write X H n-log n bits 1 read 1 write standard binary counter with delayed increment Idea: Each increment of X L performs one step of the delayed increment of X H n+1 bits2 n valueslog n + 2 reads3 writes [B., Greve, Pandey, Rao 2011] carry 1 bit 1 read 1 write 28

ValuecarryXHXH XLXL Redundant counter with E = 1/2 increment … Value = Val(X L ) + 2 |X L | ·(Val(X H )+ carry·2 Val(X L ) ) n+1 bits2 n valueslog n + 2 reads3 writes 29

ValuecarryXHXH XLXL Redundant counter with E = 1/2 n+1 bits2 n valueslog n + 3 reads2 writes delayed reset 30 increment …

b n+t-1 ∙∙∙ b n b n-1 ∙∙∙ b log n b log n-1 ∙∙∙b 0 Redundant counter with E = 1-1/2 t X L log n bit Gray code log n reads 1 write X H n-log n bits 1 read 1 write delayed standard binary counter ”Carry” : part of counter = t -3, set = 2 t -2, clear 2 t -1 n+t bits (2 t -1)·2 n values log n+t+1 reads3 writes [B., Greve, Pandey, Rao 2011] ”carry” t bits t read 1 write 31

Redundant Counters EfficiencySpaceReadsWrites 1/2n + 1 log n + 23 log n /2 t n + t log n + t + 13 log n + t + 22 Open problem 1 write and « n reads ? 32

Addition of Counters Numbers in the range 0..2 n -1 and 0..2 m -1 (m ≤ n) SpaceReadsWrites n + O(log n) Θ(m + log n) Θ(m)Θ(m) n + O(loglog n) Θ(m + log n·loglog n) n + O(1) Θ(m + log 2 n) Idea: log n blocks of 2 0,2 1,2 2,…,2 i,2 i+1,… bits A 4 A 3 A 2 A 1 A 0 B 2 B 1 B 0 m n flag = B i max value ? 33

[1] Bose, Carmi, Jansens, Maheshwai, Morin, Smid, SWAT 2010 [3] Gray, Patent 1953 [4] Rahman, Munro, Algorithmica

Thank You Gerth Stølting Brodal Aarhus University