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

Slides:



Advertisements
Similar presentations
General Sequential Design
Advertisements

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
Parity Generator and Checker
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 (presented at TAMC 2011) Gerth Stølting Brodal (Aarhus University)
Computer Science Day 2008 Algorithms and Data Structures for Faulty Memory Gerth Stølting Brodal Department of Computer Science, University of Aarhus,
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.
Fully Persistent B-Trees 23 rd Annual ACM-SIAM Symposium on Discrete Algorithms, Kyoto, Japan, January 18, 2012 Gerth Stølting Brodal Konstantinos Tsakalidis.
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.
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
A presentation on Counters
9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU1 Codes.
3. Representing Integer Data
1.6 Signed Binary Numbers.
General Fixed Radix Number Systems Nonredundant Positive radix, ß n digits in digit set Vector:
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.
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.
Computer Arithmetic and the Arithmetic Unit Lesson 2 - Ioan Despi.
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.
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.
Positional Number Systems
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.
Chapter 1 Counters. Counters Counters are sequential circuits which "count” through a specific state sequence. They can count up, count down, or count.
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
Sorting Integers in the RAM Model Gerth Stølting Brodal Joint work with Djamal Belazzougui and Jesper Sindal Nielsen (to be presented at the 14th Scandinavian.
1. Number Systems. Common Number Systems SystemBaseSymbols Used by humans? Used in computers? Decimal100, 1, … 9YesNo Binary20, 1NoYes Octal80, 1, … 7No.
1 Digital Logic Design Engr. Kashif Shahzad. 2 What’s Course About?  Digital logic, focusing on the design of computers  Stay above transistor level.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
EKT 221 – Counters.
EKT 221 : Digital 2 COUNTERS.
COUNTING IN BINARY Binary weightings 0 x x x x 8
29th Oct Review Session 8.
Strict Fibonacci Heaps
Topic 1: Data Representation
COUNTING IN BINARY Binary weightings 0 x x x x 8
CS210- Lecture 13 June 28, 2005 Agenda Heaps Complete Binary Tree
Presentation transcript:

Binary Counters Integer Representations towards Efficient Counting in the Bit Probe Model (paper presented at TAMC 2011) Gerth Stølting Brodal (Aarhus Universitet) Mark Greve (Aarhus Universitet) Vineet Pandey (BITS Pilani, Indien) S. Srinivasa Rao (Seoul, Syd Korea) MADALGO Seminar, June 1, 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 = = 11 10

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

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

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

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]

b n-1 b n-2 ∙∙∙ b 6 b 5 b 4 b 3 b 2 b 1 b 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(XY) inc(X) if (X == 0) inc(Y) Always reads n-1 bits Always writes ≤ 3 bits [B., Greve, Pandey, Rao 2011]

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 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

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

b n b n-1 ∙∙∙ b log n b log n ∙∙∙ b 0 Redundant counter with E = 1/2 X L log n bit 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

carryXHXH 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

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

b n+t-1 ∙∙∙ b n b n-1 ∙∙∙ b log n b log n ∙∙∙ b 0 Redundant counter with E = 1-O(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 -2)·2 n values log n+t+2 reads4 writes [B., Greve, Pandey, Rao 2011] ”carry” t bits t read 1 write

Redundant Counters EfficiencySpaceReadsWrites 1/2n + 1 log n + 23 log n O(1/2 t )n + t log n + t + 34 log n + t + 43 Open problem 1 write and « n reads ?

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) Ideas: log n blocks of 2 0,2 0,2 1,2 2,…,2 i,2 i+1,… bits Incremental carry propagation

THANK YOU